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 (GCC 5.4.1) (judge verdict: Accepted)

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t

#define BUF_SIZE 40

// size: specify sizeof(str)
int get_str(char *str, int size) {
    if(!fgets(str, size, stdin)) return -1;
    return 0;
}

int get_int(void) {
  int num;
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return 0;
  sscanf(line, "%d", &num);
#else
#error
#endif
  return num;
}

int get_int2(int *a1, int *a2) {
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return -1;
  sscanf(line, "%d %d", a1, a2);
#else
#error
#endif
  return 0;
}

int get_int3(int *a1, int *a2, int *a3) {
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return -1;
  sscanf(line, "%d %d %d", a1, a2, a3);
#else
#error
#endif
  return 0;
}


#define DIVISOR 1000000007
#define AB_MAX 200000

uint64_t get_power2(int n) {
    uint64_t ans = 1;
    uint64_t power2[32];
    power2[0] = 2;
    int i;
    for(i = 1; i < 31; i++) {
        power2[i] = (power2[i-1]*power2[i-1])%DIVISOR;
    }
    for(i = 0; i < 31; i++) {
        if(!(n & (1<<i))) continue;
        ans = (ans * power2[i])%DIVISOR;
    }
    return ans;
}

uint64_t inv_factorial[AB_MAX];

struct pair {
    int x;
    int y;
};

struct pair gcdext(int a, int b) {
    if(a==0) { return (struct pair){0, 1}; }
    struct pair p = gcdext(b%a, a);
    return (struct pair){p.y - b/a * p.x, p.x};
}

void prep_inv(int n) {
    inv_factorial[0] = inv_factorial[1] = 1;
    int i;
    for(i = 2; i <= n; i++) {
        struct pair p = gcdext(i, DIVISOR);
        int inv = (p.x + DIVISOR)%DIVISOR;
        inv_factorial[i] = (inv_factorial[i-1]*inv)%DIVISOR;
    }
}

uint64_t get_combi(int n, int a) {
    uint64_t ans = 1;
    uint64_t i;
    // calc numerator
    for(i = n-a+1; i <= n; i++) {
        ans = (ans * i)%DIVISOR;
    }
    ans = (ans * inv_factorial[a])%DIVISOR;
#ifdef DEBUG
    printf("get_combi: %llu\n", ans);
#endif
    return ans;
}

int main(void) {
    int n, a, b;
    get_int3(&n, &a, &b);
    uint64_t ans = get_power2(n) - 1; // n_C_0 = 1
#ifdef DEBUG
    printf("%llu\n", ans);
#endif
    prep_inv(b);
    ans = (ans + DIVISOR - get_combi(n, a))%DIVISOR;
    ans = (ans + DIVISOR - get_combi(n, b))%DIVISOR;
    printf("%d\n", (int)ans);
    return 0;
}