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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using static System.Console;
using static System.Math;
using static MyIO;
using static MyUtil;

public class D
{
	public static void Main() => (new Solver()).Solve();
}

public class Solver
{
	public void Solve()
	{
		long n = GetLong();
		long a = GetLong();
		long b = GetLong();

		var all = ModInt.ModPow(new ModInt(2), new ModInt(n));
		WriteLine(((all - 1) - comb(n, a) - comb(n, b)).Val);
	}

	private ModInt comb(long n, long x)
	{
		var res = new ModInt(1);
		for(long i = 0; i < x; i++)
			res *= new ModInt(n - i);

		for(long i = x; i > 0; i--)
			res /= new ModInt(i);

		return res;
	}
}

public struct ModInt
{
	public long Mod { get; private set; }
	public long Val { get; private set; }

	public ModInt(long v)
	{
		// must initialize (default: Mod = 0)
		Mod = 1000000007;
		Val = (v + Mod) % Mod;
	}

	public static ModInt operator+(ModInt x, ModInt y)
	{
		long mod = x.Mod;
		long tmp = x.Val + y.Val;
		if(tmp >= mod)
			tmp -= mod;
		return new ModInt(tmp);
	}

	public static ModInt operator-(ModInt x, ModInt y)
	{
		long mod = x.Mod;
		long tmp = x.Val;
		if(tmp < y.Val)
			tmp += mod;
		tmp -= y.Val;
		return new ModInt(tmp);
	}

	public static ModInt operator*(ModInt x, ModInt y)
	{
		long mod = x.Mod;
		return new ModInt((x.Val * y.Val) % mod);
	}

	public static ModInt operator/(ModInt x, ModInt y)
	{
		long mod = x.Mod;
		long pow = mod - 2;
		long yy = y.Val;
		long inv = 1;
		while(pow > 0)
		{
			if((pow & 1) == 1)
				inv = (inv * yy) % mod;
			yy = (yy * yy) % mod;
			pow >>= 1;
		}
		return new ModInt((x.Val * inv) % mod);
	}

	public static ModInt ModPow(ModInt x, ModInt y)
	{
		long mod = x.Mod;
		long exp = y.Val;
		long xx = x.Val;
		long res = 1;
		while(exp > 0)
		{
			if((exp & 1) == 1)
				res = (res * xx) % mod;

			xx = (xx * xx) % mod;
			exp >>= 1;
		}
		return new ModInt(res);
	}

	public static ModInt operator+(ModInt x, long y) => x + new ModInt(y);
	public static ModInt operator-(ModInt x, long y) => x - new ModInt(y);
	public static ModInt operator*(ModInt x, long y) => x * new ModInt(y);
	public static ModInt operator/(ModInt x, long y) => x / new ModInt(y);
	public static ModInt operator++(ModInt x) => x + new ModInt(1);
	public static ModInt operator--(ModInt x) => x - new ModInt(1);
}

public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt() => int.Parse(getArg());
	public static long GetLong() => long.Parse(getArg());
	public static double GetDouble() => double.Parse(getArg());
	public static decimal GetDecimal() => decimal.Parse(getArg());
	public static string GetString() => getArg();
	public static char GetChar() => getArg()[0];
	public static int[] GetInts(long N) => Enumerable.Range(0, (int)N).Select(_ => GetInt()).ToArray();
	public static long[] GetLongs(long N) => Enumerable.Range(0, (int)N).Select(_ => GetLong()).ToArray();
	public static double[] GetDoubles(long N) => Enumerable.Range(0, (int)N).Select(_ => GetDouble()).ToArray();
	public static decimal[] GetDecimals(long N) => Enumerable.Range(0, (int)N).Select(_ => GetDecimal()).ToArray();
	public static string[] GetStrings(long N) => Enumerable.Range(0, (int)N).Select(_ => GetString()).ToArray();
}

public static class MyUtil
{
	public static void chmax<T>(ref T x, T y) where T : IComparable<T>
	{
		if(x.CompareTo(y) < 0)
			x = y;
	}

	public static void chmin<T>(ref T x, T y) where T : IComparable<T>
	{
		if(x.CompareTo(y) > 0)
			x = y;
	}

	public static void swap<T>(ref T x, ref T y)
	{
		T tmp = x;
		x = y;
		y = tmp;
	}
}