stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <bits/stdc++.h>



#define rep(i, n) for(int i = 0; i < n; i++)



using namespace std;

using ll = long long;

int mod = 1000000007;



int num[3] = {0, 0, 0};

void add(){

    if(num[2] == 9 && num[1] == 9){

        num[0] += 1; num[1] = 0; num[2] = 0;

    }

    else if(num[2] == 9){

        num[1] += 1; num[2] = 0;

    }

    else num[2] += 1;

}



int main(void){

    int N; cin >> N;

    string S; cin >> S;

    for(int i = 0; i < 30000; i++) S += "1";

    int cnt = 0;

    for(int i = 0; i < 1000; i++){

        int idx = 0;

        for(int j = 0; j < N; j++){

            if(S[j] - '0' == num[idx]){

                idx++;

                if(idx == 3) break;

            }

        }

        if(idx == 3) cnt++;

        add();

    }

    cout << cnt << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



#define rep(i, n) for(int i = 0; i < n; i++)



typedef long long ll;

using namespace std;

int mod = 1000000007;



int main(void){

    int N; cin >> N;

    string S; cin >> S;

    vector<int> dig_pos[10];

    int num_dig[10];

    int ans = 0;

    rep(i, N) dig_pos[S[i]-'0'].push_back(i);

    rep(i, 10) num_dig[i] = dig_pos[i].size();

    rep(i, 1000){

        bool ok = false;

        string S = "";

        int val = i;

        rep(j, 3){

            S += ('0' + (val % 10));

            val /= 10;

        }

        reverse(S.begin(), S.end());

        if(num_dig[S[0]-'0'] > 0 && num_dig[S[1]-'0'] > 0 && num_dig[S[2]-'0'] > 0){

            int st = dig_pos[S[0]-'0'][0], fin = dig_pos[S[2]-'0'][num_dig[S[2]-'0']-1];

            int aim = S[1]-'0';

            rep(j, num_dig[aim]){

                if(st < dig_pos[aim][j] && dig_pos[aim][j] < fin){

                    ans++;

                    break;

                }

            }

        }

    }

    cout << ans << endl;

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define rep(i,n) REP(i,0,n)

#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)

#define repr(i, n) REPR(i, n, 0)

#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)

#define pb push_back

#define all(r) r.begin(),r.end()

#define rall(r) r.rbegin(),r.rend()

#define fi first

#define se second



typedef long long ll;

typedef vector<int> vi;

typedef vector<ll> vl;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;



const ll INF = 1e9;

const ll MOD = 1e9 + 7;

double EPS = 1e-8;



template<typename T> T chmax(T& a, const T& b){return a = (a > b ? a : b);}

template<typename T> T chmin(T& a, const T& b){return a = (a < b ? a : b);}



int main(){

    int n;

    cin >> n;

    string s;

    cin >> s;

    set<string> st;

    for(auto&& c : s) {

        set<string> tmp;

        for(auto&& t : st) {

            if(t.size() == 3) continue;

            tmp.insert(t+c);

        }

        st.insert(string(1, c));

        st.insert(tmp.begin(), tmp.end());

    }

    ll ans = 0;

    for(auto&& s : st) if(s.size() == 3) ++ans;

    cout << ans << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;

#define rep(i,n) REP(i,0,n)

#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)

#define repr(i, n) REPR(i, n, 0)

#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)

#define pb push_back

#define all(r) r.begin(),r.end()

#define rall(r) r.rbegin(),r.rend()

#define fi first

#define se second



typedef long long ll;

typedef vector<int> vi;

typedef vector<ll> vl;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;



const ll INF = 1e18;

const ll MOD = 1e9 + 7;

const double EPS = 1e-8;



template<typename T> T chmax(T& a, const T& b){return a = (a > b ? a : b);}

template<typename T> T chmin(T& a, const T& b){return a = (a < b ? a : b);}



#define DEBUG_MODE

#ifdef DEBUG_MODE

#define dump(x) cout << #x << " : " << x << " "

#define dumpL(x) cout << #x << " : " << x << '\n'

#define LINE cout << "line : " << __LINE__ << " "

#define LINEL cout << "line : " << __LINE__ << '\n'

#define dumpV(v) cout << #v << " : ["; for(auto& t : v) cout << t << ", "; cout<<"]" << " "

#define dumpVL(v) cout << #v << " : ["; for(auto& t : v) cout << t << ", "; cout<<"]" << endl

#define STOP assert(false)

#else

#define dump(x) 

#define dumpL(x) 

#define LINE 

#define LINEL 

#define dumpV(v) 

#define dumpVL(v) 

#define STOP assert(false)

#endif

#define mp make_pair

 

namespace std {

template<class S, class T>

ostream &operator <<(ostream& out, const pair<S, T>& a) {

    out << '(' << a.fi << ", " << a.se << ')';

    return out;

}

}



int main(){

    int n;

    string s;

    cin >> n >> s;

    ll ans = 0;

    vector<set<int>> st(3);

    rep(i, n) {

        int x = s[i] - '0';

        repr(i, 2) {

            for(auto&& a: st[i]) st[i+1].insert(a*10+x);

        }

        st[0].insert(x);

    }

    cout << st[2].size() << endl;

    // dumpVL(st[2]);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int main(void) {

    int n;

    cin >> n;

    string s;

    cin >> s;

    int ans=0;

    for(int a=0; a<10; a++){

        for(int b=0; b<10; b++){

            for(int c=0; c<10; c++){

                int k=0;

                for(int i=0; i<n; i++){

                    int x = stoi((string)(s.substr(i,1)));

                    if((k==0 & a==x)|(k==1 & b==x)|(k==2 & c==x)) k++;

                }

                if (k==3) ans++;

            }

        }

    }

    cout << ans << endl;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



int main(void) {

    int n;

    cin >> n;

    string s;

    cin >> s;

    int ans=0;

    for(int a=0; a<10; a++){

        for(int b=0; b<10; b++){

            for(int c=0; c<10; c++){

                int k=0;

                for(int i=0; i<n; i++){

                    int x = s[i]-48;

                    if((k==0 & a==x)|(k==1 & b==x)|(k==2 & c==x)) k++;

                    if(k==3){

                        ans++;

                        break;

                    }

                }

            }

        }

    }

    cout << ans << endl;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int main(void) {

    int n;

    cin >> n;

    string s;

    cin >> s;

    int ans=0;

    for(int a=0; a<10; a++){

        for(int b=0; b<10; b++){

            for(int c=0; c<10; c++){

                int k=0;

                for(int i=0; i<n; i++){

                    int x = stoi((string)(s.substr(i,1)));

                    if((k==0 & a==x)|(k==1 & b==x)|(k==2 & c==x)) k++;

                    if(k==3){

                        ans++;

                        break;

                    }

                }

            }

        }

    }

    cout << ans << endl;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



int main(void) {

    int n;

    cin >> n;

    string s;

    cin >> s;

    int ans=0;

    for(int a=0; a<10; a++){

        for(int b=0; b<10; b++){

            for(int c=0; c<10; c++){

                int k=0;

                for(int i=0; i<n; i++){

                    int x = s[i]-48;

                    if((k==0 & a==x)|(k==1 & b==x)|(k==2 & c==x)) k++;

                    if(k==3){

                        ans++;

                        break;

                    }

                }

            }

        }

    }

    cout << ans << endl;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <bitset>

#include <map>

#include <vector>

#include <string>

#include <climits>

#include <algorithm>

using namespace std;

int main() {



    int N;

    string S;

    cin >> N;

    cin >> S;

    

    

    int ans = 0;

    for(int i = 0; i <= 999; i++){

        string pass;

        

        if(i <= 9) pass = "00" + to_string(i);

        else if(i <= 99) pass = "0" + to_string(i);

        else pass = to_string(i);

        

        int count = 0;

        for(int i = 0; i < N; i++){

            if(S[i] == pass[count]){

                count++;

            }

            if(count == 3){

                ans++;

                break;

            }

        }

    }

    

    cout << ans << endl;

    

    return 0;

}


// Optimized solution to the same problem (faster):
#include <iostream>

using namespace std;



int main(void){

    

    int N;

    string S;

    cin >> N >> S;

    

    int ans = 0;

    string pass;

    for(int i = 0; i < 1000; i++){

        

        // passwordの基準設定(000~999)

        pass = (i / 100) + '0'; 

        pass += ((i % 100) / 10) + '0';

        pass += (i % 10) + '0';

        

        int keta = 0;

        for(int j = 0; j < N; j++){

            if(pass[keta] == S[j]) keta++;

        }

        if(keta == 3) ans++;

    }

    

    cout << ans << endl;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int64_t MOD = 1e9+7;



//---------- べき乗 ----------

int64_t power(int64_t a, int64_t n){

    if(n == 0) return 1;



    int64_t res = 1;

    while(n > 0){

        if(n % 2 == 1) res = res * a % MOD;

        a = a * a % MOD;

        n /= 2;

    }



    return res;

}



//---------- 逆元 ----------

int64_t inv(int64_t a){

    return power(a, MOD-2);

}





//--------- 組み合わせ ---------

int64_t comb(int64_t n, int64_t r){

  int64_t bunbo = 1, bunshi = 1;



  for(int i=0; i<r; i++){

    bunbo = bunbo * (r-i) % MOD;

    bunshi = bunshi * (n-i) % MOD;

  }



  return bunshi * inv(bunbo) % MOD;

}





int main(){

  int64_t N, A, B;

  cin >> N >> A >> B;

//  cout<<comb(N,A)<<" : " <<comb(N,B)<<endl;

//  cout <<power(2,N)<<endl;



  int64_t ans = power(2, N) - comb(N, A) - comb(N, B) - 1;

  while(ans < 0) ans += MOD;



  cout << ans << endl;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define rep(i,n) for (int i= 0;i<(n);++i)

using namespace std;

typedef long long ll;

typedef pair<int,int> P;

const ll MOD = 1e9+7;







ll power(ll a,ll n){ //aのn乗計算 O(log(n))

  if(n == 0)return 1;



  ll res = 1;

  while(n > 0){//nがゼロになるまで

    if(n%2 ==1)res = res * a % MOD; //奇数ならa倍してべきを偶数にしている

    a = a * a % MOD; //aを自乗

    n /= 2;//aを自乗した分べきを半分減らす

  }

  return res;

}







//フェルマーの小定理より、aで割るという処理はinv(a)をかけることと同じになる

//そのinv(a)はa^(MOD-2)で求められる

ll inv(ll a){

  return power(a,MOD-2);

}





ll comb(ll n, ll a){  //nCaの計算

  ll bunbo =1 ,bunshi = 1;



  for(ll i =1;i<=a;++i){

    bunbo = bunbo *i %MOD;//

    bunshi = bunshi * (n-i+1) %MOD;//

  }

  return bunshi*inv(bunbo) %MOD;



}





int main(){

  ll N,A,B;

  cin >>N>>A>>B;

//  cout<<comb(N,A)<<" : " <<comb(N,B)<<endl;

//  cout <<power(2,N)<<endl;



  ll ans = power(2,N) -comb(N,A) - comb(N,B) -1;

  //MODを使ってる引き算は負になった時足さないといけない

  while(ans <0)ans +=MOD;



  cout <<ans<<endl;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;

using ll = long long;

const ll mod = 1000000007;

struct mint {

  ll x;  // typedef long long ll;

  mint(ll x = 0) : x((x % mod + mod) % mod) {}

  mint operator-() const { return mint(-x); }

  mint& operator+=(const mint a) {

    if ((x += a.x) >= mod) x -= mod;

    return *this;

  }

  mint& operator-=(const mint a) {

    if ((x += mod - a.x) >= mod) x -= mod;

    return *this;

  }

  mint& operator*=(const mint a) {

    (x *= a.x) %= mod;

    return *this;

  }

  mint operator+(const mint a) const {

    mint res(*this);

    return res += a;

  }

  mint operator-(const mint a) const {

    mint res(*this);

    return res -= a;

  }

  mint operator*(const mint a) const {

    mint res(*this);

    return res *= a;

  }

  mint pow(ll t) const {

    if (!t) return 1;

    mint a = pow(t >> 1);

    a *= a;

    if (t & 1) a *= *this;

    return a;

  }



  // for prime mod

  mint inv() const { return pow(mod - 2); }

  mint& operator/=(const mint a) { return (*this) *= a.inv(); }

  mint operator/(const mint a) const {

    mint res(*this);

    return res /= a;

  }

};



mint RepeatSquaring(mint N, ll P) {

  if (P == 0) return 1;

  if (P % 2 == 0) {

    mint t = RepeatSquaring(N, P / 2);

    return t * t;

  }

  return RepeatSquaring(N, P - 1) * N;

}



mint COM(ll n, ll k) {

  mint deno = 1;

  mint mole = 1;

  for (ll i = 0; i < k; i++) {

    deno *= n - i;

    mole *= (i + 1);

  }



  mint nCk = deno / mole;

  return nCk;

}



int main() {

  ios::sync_with_stdio(false);

  cin.tie(0);

  // 前処理

  // COMinit();

  mint n, a, b;

  cin >> n.x >> a.x >> b.x;



  mint ans = RepeatSquaring(2, n.x);

  ans -= 1;



  ans -= COM(n.x, a.x);

  ans -= COM(n.x, b.x);

  cout << ans.x << endl;

}




// Optimized solution to the same problem (faster):
#include <algorithm>

#include <cmath>

#include <iostream>

using namespace std;

using ll = long long int;

const ll mod = 1000000007;



ll PowMod(ll n, ll p, ll m) {

  if (p == 0) return 1;

  if (p % 2 == 0) {

    ll t = PowMod(n, p / 2, m);

    return t * t % m;

  }

  return n * PowMod(n, p - 1, m) % m;

}



ll COM(ll n, ll r) {

  // 分母と分子。いい名前思いつかなかった

  ll res, deno, mole;

  res = deno = mole = 1;

  for (int i = 0; i < r; i++) {

    mole *= (n - i);

    mole %= mod;

    deno *= (r - i);

    deno %= mod;

  }

  // 分母の逆元

  res = PowMod(deno, mod - 2, mod);

  res = (res * mole) % mod;

  return res;

}



int main() {

  ll n, a, b;

  cin >> n >> a >> b;



  ll ans = PowMod(2, n, mod) - 1;

  ll diff = (COM(n, a) + COM(n, b)) % mod;

  cout << (ans - diff + mod) % mod << endl;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#include <algorithm>

using namespace std;



int64_t MOD = 1e9+7;



//---------- べき乗 ----------

int64_t power(int64_t a, int64_t n){

    if(n == 0) return 1;



    int64_t res = 1;

    while(n > 0){

        if(n % 2 == 1) res = res * a % MOD;

        a = a * a % MOD;

        n /= 2;

    }



    return res;

}



//---------- 逆元 ----------

int64_t inv(int64_t a){

    return power(a, MOD-2);

}





//--------- 組み合わせ ---------

int64_t comb(int64_t n, int64_t r){

  int64_t bunbo = 1, bunshi = 1;



  for(int i=0; i<r; i++){

    bunbo = bunbo * (r-i) % MOD;

    bunshi = bunshi * (n-i) % MOD;

  }



  return bunshi * inv(bunbo) % MOD;

}





int main(){ 

  int64_t N, A, B;

  cin >> N >> A >> B;



  int64_t ans = power(2, N) - comb(N, A) - comb(N, B) - 1;

  while(ans < 0) ans += MOD;



  cout << ans << endl;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#include <algorithm>

using namespace std;

 

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

#define rep1(i, n) for (int i = 1; i < (int)(n); i++)

#define print(a) cout << (a) << endl; 

typedef long long ll;

const int MOD = 1000000007; 



ll POW(ll n, ll k) {

    if (k==0) return 1;

    ll ret = 1;

    while (k > 0) {

        if (k&1) ret = ret * n % MOD;

        n = (n * n) % MOD;

        k >>= 1;

    }

    return ret;

}



ll FACT(ll n, ll k) {

    ll ret = 1;

    for (int i = 0; i < k; ++i) {

        ret = ret * (n - i) % MOD;

    }

    return ret;

}



ll COM2(ll n, ll k) {

    ll x = FACT(n, k);

    ll y = FACT(k, k);

    ll mody = POW(y, MOD-2);

    return x * mody % MOD; 

}



int main() {

    ll n, a, b;

    cin >> n >> a >> b;

    ll ret = POW(2, n);

    ret -= 1;

    ret -= COM2(n, a);

    ret -= COM2(n, b);

    while (ret < 0) ret += MOD;

    cout << ret << endl;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;



const ll MOD = 1e9 + 7;

ll n,a,b;



ll pow(ll a, ll b, ll m)

{

    ll ans = 1;

    a %= m;

    while(b)

    {

        if(b & 1)ans = (ans % m) * (a % m) % m;

        b /= 2;

        a = (a % m) * (a % m) % m;

    }

    ans %= m;

    return ans;

}



ll inv(ll x, ll p)//x关于p的逆元，p为素数

{

    return pow(x, p - 2, MOD);

}



ll C(ll n, ll m, ll p)//组合数C(n, m) % p

{

    if(m > n)return 0;

    ll up = 1, down = 1;//分子分母;

    for(int i = n - m + 1; i <= n; i++)up = up * i % p;

    for(int i = 1; i <= m; i++)down = down * i % p;

    return up * inv(down, p) % p;

}



ll Lucas(ll n, ll m, ll p)

{

    if(m == 0)return 1;

    return C(n % p, m % p, p) * Lucas(n / p, m / p, p) % p;

}



int main(){

	cin >> n >> a >> b;

	if( b >= n / 2 ) b = n - b;

	ll ca = Lucas(n , a, MOD);

	ll cb = Lucas(n , b, MOD);

	ll c = (ca + cb) % MOD;

	c = (pow(2,n,MOD) - c - 1 + MOD) % MOD;

	cout << c << endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<iostream>

#include<algorithm>

#include<cstdio>

#include<cstring>



using namespace std;



typedef long long LL;



const int N = 50010, mod = 1e9 + 7;



int primes[N], cnt;

bool st[N];



void init(int n)

{

    for(int i = 2; i <= n; i ++)

    {

        if(!st[i])  primes[cnt ++] = i;

        for(int j = 0; primes[j] <= n / i; j ++)

        {

            st[i * primes[j]] = true;

            if(i % primes[j] == 0)  break;

        }

    }

}



int qmi(int a, int k)

{

    int res = 1;

    while(k)

    {

        if(k & 1)  res = (LL)res * a % mod;

        k >>= 1;

        a = (LL)a * a % mod;

    }

    return res;

}



int C(int a, int b)

{

    if(a < b)  return 0;

    

    int up = 1, down = 1;

    for(int i = a, j = b; j; i --, j --)

    {

        up = (LL)up * i % mod;

        down = (LL)down * j % mod;

    }

    return (LL)up * qmi(down, mod - 2) % mod;

}



int main()

{

    //init(N - 1);

    

    int n, a, b;

    scanf("%d%d%d", &n, &a, &b);

    

    int res = (((LL)qmi(2, n) - 1 - C(n, a) - C(n, b)) % mod + mod) % mod;

    printf("%d", res);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
// D - Bouquet

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

ll N,A,B;

ll MOD = 1000000007;



// a^n mod m を計算する(二分累乗法:O(logn))

ll modpow(ll a, ll n, ll m) {

	ll res = 1;

	while(n > 0){

		if(n & 1) res = res * a % m;

		a = a * a % m;

		n >>= 1;

	}

	return res;

}



// nCr mod m

ll nCr(ll n, ll r, ll m){

	ll a = 1, b = 1;

	for(ll i=0; i<r; ++i){

		a = a * (n-i) % m;

		b = b * (r-i) % m;

	}

	return a * modpow(b, m-2, m) % m;

}



ll solve(){

	ll sum_nCr = modpow(2, N, MOD) - 1;

	ll nca = nCr(N, A, MOD);

	ll ncb = nCr(N, B, MOD);

	ll ans = (sum_nCr - (nca + ncb)%MOD)%MOD;

	if(ans < 0L) ans += MOD;

	return ans;

}



int main(){

	cin>>N>>A>>B;

	cout<< solve() <<endl;

}

// Optimized solution to the same problem (faster):
// D - Bouquet

#include <bits/stdc++.h>

using namespace std;

using ll = long long;



#define MOD 1000000007



// a^n mod m を計算する(二分累乗法:O(logn))

ll modpow(ll a, ll n) {

	ll m = MOD;

	ll x = 1;

	while(n){

		if(n & 1) x = x * a % m;

		a = a * a % m;

		n >>= 1;

	}

	return x;

}



// nCr mod m

ll nCr(ll n, ll r){

	ll m = MOD;

	ll a = 1, b = 1;

	for(ll i=1; i<=r; ++i){

		a *= n - i + 1;

		b *= i;

		a %=m;

		b %=m;

	}

	return a * modpow(b, m-2) % m;

}



int main(){

	ll N,A,B; cin>>N>>A>>B;

	ll ans = modpow(2, N) - 1;

	ans -= nCr(N, A);

	ans -= nCr(N, B);

	ans %= MOD;

	if(ans < 0L) ans += MOD;

	cout<< ans <<endl;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
// D - Bouquet

#include <bits/stdc++.h>

using namespace std;

using ll = long long;



// a^n mod m を計算する(二分累乗法:O(logn))

ll modpow(ll a, ll n, ll m) {

	ll x = 1;

	while(n){

		if(n & 1) x = x * a % m;

		a = a * a % m;

		n >>= 1;

	}

	return x;

}



// nCr mod m

ll nCr(ll n, ll r, ll m){

	ll a = 1, b = 1;

	for(ll i=1; i<=r; ++i){

		a *= n - i + 1;

		b *= i;

		a %=m;

		b %=m;

	}

	return a * modpow(b, m-2, m) % m;

}



int main(){

	ll MOD = 1000000007, N,A,B;

	cin>>N>>A>>B;

	ll ans = modpow(2, N, MOD) - 1;

	ans -= nCr(N, A, MOD);

	ans -= nCr(N, B, MOD);

	ans %= MOD;

	if(ans < 0L) ans += MOD;

	cout<< ans <<endl;

}

// Optimized solution to the same problem (faster):
// D - Bouquet

#include <bits/stdc++.h>

using namespace std;

using ll = long long;



#define MOD 1000000007



// a^n mod m を計算する(二分累乗法:O(logn))

ll modpow(ll a, ll n) {

	ll m = MOD;

	ll x = 1;

	while(n){

		if(n & 1) x = x * a % m;

		a = a * a % m;

		n >>= 1;

	}

	return x;

}



// nCr mod m

ll nCr(ll n, ll r){

	ll m = MOD;

	ll a = 1, b = 1;

	for(ll i=1; i<=r; ++i){

		a *= n - i + 1;

		b *= i;

		a %=m;

		b %=m;

	}

	return a * modpow(b, m-2) % m;

}



int main(){

	ll N,A,B; cin>>N>>A>>B;

	ll ans = modpow(2, N) - 1;

	ans -= nCr(N, A);

	ans -= nCr(N, B);

	ans %= MOD;

	if(ans < 0L) ans += MOD;

	cout<< ans <<endl;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define ll long long

#define inf 0x3f3f3f3f

using namespace std;

const ll mod = 1e9 + 7;

const int maxn = 2e5 + 5;

ll fac[maxn],inv[maxn];



ll modpow(ll a,ll b){return b ? modpow(a*a%mod,b/2)*(b%2?a:1)%mod : 1;}

ll prm(ll n, ll k){

  ll res = 1;

  for(int i=0;i<k;i++){ res = res * (n-i) % mod; }

  return res;

}

ll modinv(ll a, ll p){ return modpow( a, p-2 ); }

ll cmb(ll n,ll k){

	k = min(k, n-k);

	return prm(n,k) * modinv(prm(k,k), mod) % mod;

} 

int main(){

	ll n,a,b;

	cin>>n>>a>>b;

	ll ans = modpow(2,n) - 1 - cmb(n,a) - cmb(n,b);

	ans = (ans % mod + mod) % mod;

	cout << ans << "\n";

}

// Optimized solution to the same problem (faster):
// #include <bits/stdc++.h>

#include <stdio.h>

#define ll long long

#define inf 0x3f3f3f3f

// using namespace std;

const ll mod = 1e9 + 7;

const int maxn = 2e5 + 5;

ll fac[maxn],inv[maxn];



ll modpow(ll a,ll b){return b ? modpow(a*a%mod,b/2)*(b%2?a:1)%mod : 1;}

ll prm(ll n, ll k){

  ll res = 1;

  for(int i=0;i<k;i++){ res = res * (n-i) % mod; }

  return res;

}

ll modinv(ll a, ll p){ return modpow( a, p-2 ); }

ll cmb(ll n,ll k){

	if(k > n-k){ k = n-k; }

	return prm(n,k) * modinv(prm(k,k), mod) % mod;

} 

int main(){

	ll n,a,b;

// 	cin>>n>>a>>b;

	scanf("%lld %lld %lld", &n, &a, &b);

	ll ans = modpow(2,n) - 1 - cmb(n,a) - cmb(n,b);

	ans = (ans % mod + mod) % mod;

	printf("%lld\n", ans);

}

// Fastest known solution for this problem: