Problem:
Score : 400 points

Problem Statement

Akari has n kinds of flowers, one of each kind.

She is going to choose one or more of these flowers to make a bouquet.

However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b.

How many different bouquets are there that Akari can make?

Find the count modulo (10^9 + 7).

Here, two bouquets are considered different when there is a flower that is used in one of the bouquets but not in the other bouquet.

Constraints

All values in input are integers.

2 \leq n \leq 10^9

1 \leq a < b \leq \textrm{min}(n, 2 \times 10^5)

Input

Input is given from Standard Input in the following format:

n a b

Output

Print the number of bouquets that Akari can make, modulo (10^9 + 7). (If there are no such bouquets, print 0.)

Sample Input 1

4 1 3

Sample Output 1

7

In this case, Akari can choose 2 or 4 flowers to make the bouquet.

There are 6 ways to choose 2 out of the 4 flowers, and 1 way to choose 4, so there are a total of 7 different bouquets that Akari can make.

Sample Input 2

1000000000 141421 173205

Sample Output 2

34076506

Print the count modulo (10^9 + 7).

Solution in C# (Mono 4.6.2.0) (judge verdict: Accepted)

using System;
using System.Numerics;
using System.Linq;

class Program
{
    static long mod = 1000000000 + 7;


    static void Main(string[] args)
    {

        var l1 = ReadLongArray();

        long N = l1[0];
        long a = l1[1];
        long b = l1[2];

        long numMax = Math.Min(N, 200000);
        long total = Pow_mod(2, N, mod) -1;
        total -= Combination(N, a, mod);
        if (total < 0) total += mod;

        total -= Combination(N, b,mod);
        if (total < 0) total += mod;

        var result = total;

        Console.WriteLine(result);
    }



    public static long Combination(long n, long r, long mod)
    {
        if (n < 0 || r < 0 || r > n) throw new ArgumentException("不正な引数です．");

        if (n - r < r) r = n - r;
        if (r == 0) return 1;
        if (r == 1) return n;

        long[] numerator = new long[r];
        long[] denominator = new long[r];

        for (int k = 0; k < r; k++)
        {
            numerator[k] = n - r + k + 1;
            denominator[k] = k + 1;
        }

        for (int p = 2; p <= r; p++)
        {
            long pivot = denominator[p - 1];
            if (pivot > 1)
            {
                long offset = (n - r) % p;
                for (int k = p - 1; k < r; k += p)
                {
                    numerator[k - offset] /= pivot;
                    denominator[k] /= pivot;
                }
            }
        }

        long result = 1;
        for (int k = 0; k < r; k++)
        {
            if (numerator[k] > 1)
            {
                result *= numerator[k];
                result %= mod;
            }
        }

        return result;
    }


    static long Pow_mod(long a, long n, long mod)
    {
        long res = 1;
        while (n > 0)
        {
            var bit = n & 1;
            if (bit != 0) res = res * a % mod;
            a = a * a % mod;
            n >>= 1;
        }
        return res;
    }




    static string[] ReadStringArray()
    {
        return Console.ReadLine().Trim().Split(' ');
    }

    static int[] ReadIntArray()
    {
        return ReadStringArray().Select(_ => int.Parse(_)).ToArray();
    }

    static long[] ReadLongArray()
    {
        return ReadStringArray().Select(_ => long.Parse(_)).ToArray();
    }
}