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 Rust (1.15.1) (judge verdict: Accepted)

#[warn(unused_mut)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[warn(unused_mut)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[warn(unused_mut)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

/// ans = 2^n - comb(n, a) - comb(n, b)
/// comb(n, k) = n * (n-1) * ... * (n-a+1) / a / (a-1) / ... / 1

fn my_pow(n: u64, a: u64) -> u64 {
    let mut ret = 1;
    let mut tmp = a;
    let mut n = n;
    while n > 0 {
        if n & 1 == 1 {
            ret *= tmp;
            ret %= 1000000007;
        }

        tmp *= tmp;
        tmp %= 1000000007;
        n /= 2;
    }

    ret
}

fn mod_inv(n: u64) -> u64 {
    return my_pow(1000000005, n);
}

fn comb(n: u64, k: u64) -> u64 {
    let mut ret = 1;

    for i in n-k+1..n+1 {
        ret *= i;
        ret %= 1000000007;
    }

    for i in 1..k+1 {
        ret *= mod_inv(i);
        ret %= 1000000007;
    }

    ret
}

fn main() {
    input!{
        n: u64,
        a: u64,
        b: u64,
    }

    let mut ans = my_pow(n, 2);
    ans = (ans + 1000000007 - comb(n, a)) % 1000000007;
    ans = (ans + 1000000007 - comb(n, b)) % 1000000007;
    ans -= 1;
    println!("{}", ans);
}