stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 1.2264735412720804x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 1.4930616449603362x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 1.466712833469154x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 1.4930616449603362x):
#include <iostream>

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]-'0';

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

                    if(k==3){

                        ans++;

                        break;

                    }

                }

            }

        }

    }

    cout << ans << endl;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 1.466712833469154x):
#include <iostream>

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]-'0';

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

                    if(k==3){

                        ans++;

                        break;

                    }

                }

            }

        }

    }

    cout << ans << endl;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 1.1705722170262958x):
#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;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 1.7907122781442701x):
#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;

}
// Slower C++ solution:
#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;

}




// Faster C++ solution for the same problem (measured speedup: 1.8822900386906032x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 1.7765332595751369x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 1.6237867505941692x):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll exp(ll a,ll b,ll m){

  int r=1;

  while(b>0){

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

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

    b>>=1;

  }

  return r;

}

ll comb(ll n, ll k) {

    ll x = 1;

    for(int i=n-k+1; i<=n; i++) {

        x = x*i%1000000007;

    }

 

    ll y = 1;

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

        y = y*i%1000000007;

    }

    y = exp(y, 1000000007-2,1000000007);

 

    return x*y%1000000007;

}

int main(){

    

  ll n,a,b;cin>>n>>a>>b;

  cout<<((exp(2,n,1000000007)-(comb(n,a)+comb(n,b))%1000000007)+1000000007)%1000000007-1<<endl;

  

  return 0;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 1.842566141487492x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 1.2630608713240388x):
#include <bits/stdc++.h>

#define ll long long

using namespace std;

ll modpow(ll a, ll b, ll m)

{

    if (b == 0) return 1%m;

    ll u = modpow(a, b / 2, m);

    u = ((u%m) * (u%m)) % m;

    if (b%2) u = ((a%m) * (u%m))%m;

    return u;

}



const int mod = (int) 1e9 + 7;



ll ncr(ll n, ll r)

{

    if (n - r < r) r = n - r;

    ll ans = 1;

    ll fr = 1;

    for (int i = 1, j = n; i <= r; i++, j--) {

        ans = ((ans%mod) *( j%mod))%mod;

        fr = ((fr%mod)  * (i%mod)) % mod;

    }

    return ((ans%mod) * modpow(fr, mod - 2, mod)) % mod;

}



void solve()

{

    int n, a, b;

    cin >> n >> a >> b;

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

    ans = ans - ncr(n, a) - ncr(n, b);

    cout << (ans%mod + mod)%mod << "\n";

}



int main()

{



    int t = 1;

    while (t--) 

    {

        solve();

    }

}
// Slower C++ solution:
// 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;

}

// Faster C++ solution for the same problem (measured speedup: 2.02267321730673x):
// 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;

}