Under construction

Still being built. Things may change

SubsetCheating

Interview

Time limit1sMemory limit1024 MB

Summary
Count the score assignments over N problems where Little Triangle's score is at most Little Square's on each problem, with totals A and B, modulo 1e9+7.
Level

Medium5 of 10

Topics
Math, Combinatorics
Solved
No attempts yet

Problem

Little Square and Little Triangle took a math test. Little Triangle did not study for the test, but Little Square, his best friend, studied well, so Little Triangle was able to copy parts of Little Square's solutions during the test.

The test had NN problems in total. On each problem, Little Triangle's score is not more than Little Square's score. All scores are nonnegative integers. We do not know the exact score on any problem, but we know that Little Square has AA points in total and Little Triangle has BB points in total.

Given NN, AA, and BB, compute the number of ways the two of them could have been scored on the test, modulo 109+710^9 + 7.

Input

The only line of standard input contains three nonnegative integers NN, AA, and BB, separated by a single space, with the meanings explained above.

Output

The standard output contains one integer: the number of ways Little Square and Little Triangle could have been scored on the test, modulo 109+710^9 + 7.

Constraints

  • 1≤N≤1061 ≤ N ≤ 10^6
  • 0≤A,B≤1060 ≤ A, B ≤ 10^6
  • Two ways of scoring are considered different if Little Square or Little Triangle has a different number of points on at least one of the NN problems.

Hint

In the first example, there are N=2N = 2 problems. Little Square has A=3A = 3 points in total, and Little Triangle has B=2B = 2 points in total. Let P1P1 be the first problem and P2P2 the second. There are 6 distinct ways:

  • Little Square: 0 points on P1, 3 points on P2; Little Triangle: 0 points on P1, 2 points on P2
  • Little Square: 1 point on P1, 2 points on P2; Little Triangle: 0 points on P1, 2 points on P2
  • Little Square: 1 point on P1, 2 points on P2; Little Triangle: 1 point on P1, 1 point on P2
  • Little Square: 2 points on P1, 1 point on P2; Little Triangle: 2 points on P1, 0 points on P2
  • Little Square: 2 points on P1, 1 point on P2; Little Triangle: 1 point on P1, 1 point on P2
  • Little Square: 3 points on P1, 0 points on P2; Little Triangle: 2 points on P1, 0 points on P2

Examples4

  1. Example 1

    Input
    2 3 2
    
    Expected output
    6
    
  2. Example 2

    Input
    2 4 6
    
    Expected output
    0
    
  3. Example 3

    Input
    36 43 27
    
    Expected output
    207434534
    
  4. Example 4

    Input
    100001 999999 888888
    
    Expected output
    991579070