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 Go (1.6) (judge verdict: Time Limit Exceeded)

package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var sc *bufio.Scanner

func init() {
	// 100MB
	bufsize := 100 * 1024 * 1024
	sc = bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, bufio.MaxScanTokenSize), bufsize)
	sc.Split(bufio.ScanWords)
}
func readInt() int              { return readIntArray(1)[0] }
func readInt2() (int, int)      { a := readIntArray(2); return a[0], a[1] }
func readInt3() (int, int, int) { a := readIntArray(3); return a[0], a[1], a[2] }
func readIntArray(n int) []int {
	s := readStringArray(n)
	a := make([]int, n)
	for i := range a {
		a[i], _ = strconv.Atoi(s[i])
	}
	return a
}
func readString() string            { return readStringArray(1)[0] }
func readString2() (string, string) { a := readStringArray(2); return a[0], a[1] }
func readStringArray(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		sc.Scan()
		a[i] = sc.Text()
	}
	return a
}
func max(ns ...int) int {
	max := ns[0]
	for _, n := range ns {
		if n > max {
			max = n
		}
	}
	return max
}
func min(ns ...int) int {
	min := ns[0]
	for _, n := range ns {
		if n < min {
			min = n
		}
	}
	return min
}
func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func main() {
	n, a, b := readInt3()

	base := big.NewInt(0).Exp(big.NewInt(2), big.NewInt(int64(n)), nil)
	nca := comb(n, a)
	ncb := comb(n, b)

	result := big.NewInt(0).Sub(
		big.NewInt(0).Sub(
			big.NewInt(0).Sub(
				base, nca,
			), ncb,
		), big.NewInt(1),
	)

	fmt.Printf(big.NewInt(0).Mod(result, big.NewInt(1000000007)).String())

	//fmt.Printf("2**n-1: %s\n", big.NewInt(0).Exp(big.NewInt(2), big.NewInt(int64(n)), nil).String())
	//fmt.Printf("nCa: %s\n", comb(n, a).String())
	//fmt.Printf("nCb: %s\n", comb(n, b).String())
}

//func total(n int) int {
//	var total int
//	for i := 1; i <= n; i++ {
//		c := comb(n, i)
//		//fmt.Println(c)
//		total += c
//	}
//	return total
//}

func comb(n, c int) *big.Int {
	upper := big.NewInt(0).MulRange(1, int64(n))

	ll := big.NewInt(0).MulRange(1, int64(c))

	lr := big.NewInt(0).MulRange(1, int64(n-c))

	lower := big.NewInt(0).Mul(ll, lr)
	result := big.NewInt(0).Div(upper, lower)
	return result
}