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)

// This code is generated by [cargo-atcoder](https://github.com/tanakh/cargo-atcoder)
// Original source code:
/*
#[allow(unused_macros)]
macro_rules! debug {
	($($a:expr),*) => {
		println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
	}
}

const MOD: usize = 1e9 as usize + 7;

pub mod mod_int {
	use super::MOD;
	use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign};
	type Num = usize;

	#[derive(Clone, Copy)]
	pub struct ModInt<T: Copy + Clone>(pub T);

	impl Add<ModInt<Num>> for ModInt<Num> {
		type Output = ModInt<Num>;
		fn add(self, rhs: ModInt<Num>) -> ModInt<Num> {
			self + rhs.0
		}
	}

	impl Add<Num> for ModInt<Num> {
		type Output = ModInt<Num>;
		fn add(self, mut rhs: Num) -> ModInt<Num> {
			if rhs >= MOD {
				rhs %= MOD;
			}
			let mut t = rhs + self.0;
			if t >= MOD {
				t = t - MOD;
			}
			ModInt(t)
		}
	}

	impl Sub<Num> for ModInt<Num> {
		type Output = ModInt<Num>;
		fn sub(self, rhs: Num) -> ModInt<Num> {
			let rhs = if rhs >= MOD { rhs % MOD } else { rhs };
			let value = if self.0 < rhs { self.0 + MOD } else { self.0 };
			ModInt(value - rhs)
		}
	}

	impl Sub<ModInt<Num>> for ModInt<Num> {
		type Output = ModInt<Num>;
		fn sub(self, rhs: ModInt<Num>) -> ModInt<Num> {
			self - rhs.0
		}
	}

	impl AddAssign<Num> for ModInt<Num> {
		fn add_assign(&mut self, other: Num) {
			*self = *self + other;
		}
	}
	impl AddAssign<ModInt<Num>> for ModInt<Num> {
		fn add_assign(&mut self, other: ModInt<Num>) {
			*self = *self + other;
		}
	}

	impl SubAssign<Num> for ModInt<Num> {
		fn sub_assign(&mut self, other: Num) {
			*self = *self - other;
		}
	}

	impl SubAssign<ModInt<Num>> for ModInt<Num> {
		fn sub_assign(&mut self, other: ModInt<Num>) {
			*self = *self - other;
		}
	}

	impl Div<Num> for ModInt<Num> {
		type Output = ModInt<Num>;
		fn div(self, mut rhs: Num) -> ModInt<Num> {
			if rhs >= MOD {
				rhs %= MOD;
			}
			self * ModInt(rhs).pow(MOD - 2)
		}
	}

	impl Div<ModInt<Num>> for ModInt<Num> {
		type Output = ModInt<Num>;
		fn div(self, rhs: ModInt<Num>) -> ModInt<Num> {
			self / rhs.0
		}
	}

	impl DivAssign<Num> for ModInt<Num> {
		fn div_assign(&mut self, rhs: Num) {
			*self = *self / rhs
		}
	}
	impl DivAssign<ModInt<Num>> for ModInt<Num> {
		fn div_assign(&mut self, rhs: ModInt<Num>) {
			*self = *self / rhs
		}
	}

	impl Mul<ModInt<Num>> for ModInt<Num> {
		type Output = ModInt<Num>;

		fn mul(self, rhs: ModInt<Num>) -> ModInt<Num> {
			self * rhs.0
		}
	}
	impl Mul<Num> for ModInt<Num> {
		type Output = ModInt<Num>;

		fn mul(self, mut rhs: Num) -> ModInt<Num> {
			if rhs >= MOD {
				rhs %= MOD;
			}
			let t = (self.0 * rhs) % MOD;
			ModInt(t)
		}
	}

	impl MulAssign<Num> for ModInt<Num> {
		fn mul_assign(&mut self, rhs: Num) {
			*self = *self * rhs;
		}
	}

	impl MulAssign<ModInt<Num>> for ModInt<Num> {
		fn mul_assign(&mut self, rhs: ModInt<Num>) {
			*self = *self * rhs;
		}
	}

	impl ModInt<Num> {
		pub fn pow(self, e: usize) -> ModInt<Num> {
			let mut result = ModInt(1);
			let mut cur = self;
			let mut e = e;
			while e > 0 {
				if e & 1 == 1 {
					result *= cur;
				}
				e >>= 1;
				cur *= cur;
			}
			result
		}
	}
}

fn n_c_a(n: usize, a: usize) -> mod_int::ModInt<usize> {
	let mut up = mod_int::ModInt(1);
	let mut down = mod_int::ModInt(1);
	for i in 0..a {
		up *= n - i;
		down *= i + 1;
	}
	up / down
}

fn main() {
	let (r, w) = (std::io::stdin(), std::io::stdout());
	let mut sc = IO::new(r.lock(), w.lock());

	let mut n: usize = sc.read();
	let a: usize = sc.read();
	let b: usize = sc.read();

	let mut ans = mod_int::ModInt(2).pow(n) - 1;
	ans -= n_c_a(n, a);
	ans -= n_c_a(n, b);

	println!("{}", ans.0);
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
	pub fn new(r: R, w: W) -> IO<R, W> {
		IO(r, std::io::BufWriter::new(w))
	}
	pub fn write<S: std::ops::Deref<Target = str>>(&mut self, s: S) {
		use std::io::Write;
		self.1.write(s.as_bytes()).unwrap();
	}
	pub fn read<T: std::str::FromStr>(&mut self) -> T {
		use std::io::Read;
		let buf = self
			.0
			.by_ref()
			.bytes()
			.map(|b| b.unwrap())
			.skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
			.take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
			.collect::<Vec<_>>();
		unsafe { std::str::from_utf8_unchecked(&buf) }
			.parse()
			.ok()
			.expect("Parse error.")
	}
	pub fn read_vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
		(0..n).map(|_| self.read()).collect()
	}
	pub fn read_chars(&mut self) -> Vec<char> {
		self.read::<String>().chars().collect()
	}
	pub fn read_char_grid(&mut self, n: usize) -> Vec<Vec<char>> {
		(0..n).map(|_| self.read_chars()).collect()
	}
	pub fn read_pairs<T: std::str::FromStr, U: std::str::FromStr>(
		&mut self,
		n: usize,
	) -> Vec<(T, U)> {
		(0..n)
			.map(|_| (self.read::<T>(), self.read::<U>()))
			.collect::<Vec<(T, U)>>()
	}
	pub fn read_matrix<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
		(0..n)
			.map(|_| (0..m).map(|_| self.read()).collect())
			.collect()
	}
}
*/

fn main() {
    let exe = "/tmp/bin41D5D426";
    std::io::Write::write_all(&mut std::fs::File::create(exe).unwrap(), &decode(BIN)).unwrap();
    std::fs::set_permissions(exe, std::os::unix::fs::PermissionsExt::from_mode(0o755)).unwrap();
    std::process::exit(std::process::Command::new(exe).status().unwrap().code().unwrap())
}

fn decode(v: &str) -> Vec<u8> {
    let mut ret = vec![];
    let mut buf = 0;
    let mut tbl = vec![64; 256];
    for i in 0..64 { tbl[TBL[i] as usize] = i as u8; }
    for (i, c) in v.bytes().filter_map(|c| { let c = tbl[c as usize]; if c < 64 { Some(c) } else { None } }).enumerate() {
        match i % 4 {
            0 => buf = c << 2,
            1 => { ret.push(buf | c >> 4); buf = c << 4; }
            2 => { ret.push(buf | c >> 2); buf = c << 6; }
            3 => ret.push(buf | c),
            _ => unreachable!(),
        }
    }
    ret
}

const TBL: &'static [u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
const BIN: &'static str = "<base64-encoded ELF executable removed>";