electicode
HomeCoursesResourcesProblemsNational OlympiadContestsLeaderboard
...

Bouquet

Time Limit: 1000msMemory Limit: 256MB
View Submissions

Problem Description

Somon has nnn types of flowers, one of each. He is going to choose one or more of these flowers to make a bouquet. However, she does not like two numbers aaa and bbb, so the number of flowers in the bouquet cannot be equal to aaa or bbb. How many different bouquets can Somon make? Find the number of bouquets modulo (109+7)(10^9+7)(109+7). Here, two bouquets are considered different if there is a flower that is used in one bouquet but absent in the other.

Input Format

The only line of the input contains three integers nnn, aaa and bbb (2≤n≤109,1≤a<b≤min⁡(n,2×105))(2 \le n \le 10^9, 1 \le a < b \le \min(n, 2 \times 10^5))(2≤n≤109,.

Output Format

Print a single number --- the answer to the problem modulo (109+7)(10^9+7)(109+7).

Examples

Example 1
Input
4 1 3
Output
7
Example 2
Input
1000000000 141421 173205
Output
34076506

© 2026 Electicode. All rights reserved.

1
≤
a<
b≤
min(n,2×
105))