Language: C++

//参考記事
//https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a#3-%E5%89%B2%E3%82%8A%E7%AE%97-a--b
//https://noshi91.hatenablog.com/entry/2019/03/31/174006



//インクルード(アルファベット順)
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素


template<ll mod> class modint{
public:
    ll val=0;
    //コンストラクタ
    modint(ll x=0):val(x%mod){while(x<0)x+=mod;}
    //算術演算子
    modint operator +(const modint &r){return modint(*this)+=r;}
    modint operator -(const modint &r){return modint(*this)-=r;}
    modint operator *(const modint &r){return modint(*this)*=r;}
    modint operator /(const modint &r){return modint(*this)/=r;}
    //代入演算子
    modint &operator +=(const modint &r){
        val+=r.val;
        if(val>=mod)val-=mod;
        return *this;
    }
    modint &operator -=(const modint &r){
        if(val<r.val)val+=mod;
        val-=r.val;
        return *this;
    }
    modint &operator *=(const modint &r){
        val=val*r.val%mod;
        return *this;
    }
    modint &operator /=(const modint &r){
        ll a=r.val,b=mod,u=1,v=0;
        while(b){
            ll t=a/b;
            a-=t*b;swap(a,b);
            u-=t*v;swap(u,v);
        }
        val=val*u%mod;
        if(val<0)val+=mod;
        return *this;
    }
    //等価比較演算子
    bool operator ==(const modint& r){return this->val==r.val;}
    bool operator <(const modint& r){return this->val<r.val;}
    bool operator !=(const modint& r){return this->val!=r.val;}
    //入出力ストリーム
    friend istream &operator >>(istream &is,const modint<mod>& x){
        ll t;is >> t;
        x=modint<mod>(t);
        return (is);
    }
    friend ostream &operator <<(ostream &os,const modint<mod>& x){
        return os<<x.val;
    }
    //累乗
    friend modint<mod> modpow(const modint<mod> &a,ll n){
        if(n==0)return 1;
        modint<mod> t=modpow(a,n/2);
        t=t*t;
        if(n&1)t=t*a;
        return t;
    }
};

using mint = modint<MOD>;

istream &operator >>(istream &is,const mint& x){
    ll t;is >> t;
    x=mint(t);
    return (is);
}
ostream &operator <<(ostream &os,const mint& x){
    return os<<x.val;
}
mint modpow(const mint &a,ll n){
    if(n==0)return 1;
    modint<mod> t=modpow(a,n/2);
    t=t*t;
    if(n&1)t=t*a;
    return t;
}

signed main(){
    //入力の高速化用のコード
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);
    ll n,a,b;cin >> n >> a >> b;
    const mint x=2;
    mint ans=modpow(x,n);
    ans-=1;
    vector<mint> com(b+1);
    FOR(i,1,b){
        if(i==1){
            com[i]=n;
        }else{
            com[i]=com[i-1];
            com[i]*=(n-i+1);
            com[i]/=i;
        }
    }
    ans=ans-com[a]-com[b];
    cout << ans << endl;
}

Compiler output:
a.cc: In instantiation of 'class modint<1000000007>':
a.cc:117:16:   required from here
  117 |     ll t;is >> t;
      |                ^
a.cc:96:21: error: redefinition of 'std::istream& operator>>(std::istream&, const modint<1000000007>&)'
   96 |     friend istream &operator >>(istream &is,const modint<mod>& x){
      |                     ^~~~~~~~
a.cc:116:10: note: 'std::istream& operator>>(std::istream&, const mint&)' previously defined here
  116 | istream &operator >>(istream &is,const mint& x){
      |          ^~~~~~~~
a.cc: In function 'std::istream& operator>>(std::istream&, const mint&)':
a.cc:118:13: error: passing 'const mint' {aka 'const modint<1000000007>'} as 'this' argument discards qualifiers [-fpermissive]
  118 |     x=mint(t);
      |             ^
a.cc:55:24: note:   in call to 'constexpr modint<1000000007>& modint<1000000007>::operator=(modint<1000000007>&&)'
   55 | template<ll mod> class modint{
      |                        ^~~~~~
a.cc: At global scope:
a.cc:121:10: error: redefinition of 'std::ostream& operator<<(std::ostream&, const mint&)'
  121 | ostream &operator <<(ostream &os,const mint& x){
      |          ^~~~~~~~
a.cc:101:21: note: 'std::ostream& operator<<(std::ostream&, const modint<1000000007>&)' previously declared here
  101 |     friend ostream &operator <<(ostream &os,const modint<mod>& x){
      |                     ^~~~~~~~
a.cc:124:6: error: redefinition of 'mint modpow(const mint&, ll)'
  124 | mint modpow(const mint &a,ll n){
      |      ^~~~~~
a.cc:105:24: note: 'modint<1000000007> modpow(const modint<1000000007>&, ll)' previously declared here
  105 |     friend modint<mod> modpow(const modint<mod> &a,ll n){
      |                        ^~~~~~
a.cc: In function 'mint modpow(const mint&, ll)':
a.cc:126:12: error: 'mod' was not declared in this scope; did you mean 'modf'?
  126 |     modint<mod> t=modpow(a,n/2);
      |            ^~~
      |            modf
a.cc:126:15: error: template argument 1 is invalid
  126 |     modint<mod> t=modpow(a,n/2);
      |               ^
a.cc:126:25: error: cannot convert 'modint<1000000007>' to 'int' in initialization
  126 |     modint<mod> t=modpow(a,n/2);
      |                   ~~~~~~^~~~~~~
      |                         |
      |                         modint<1000000007>
a.cc:128:15: error: no match for 'operator*' (operand types are 'int' and 'const mint' {aka 'const modint<1000000007>'})
  128 |     if(n&1)t=t*a;
      |              ~^~
      |              | |
      |              | const mint {aka const modint<1000000007>}
      |              int
In file included from a.cc:11:
/usr/include/c++/14/complex:400:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)'
  400 |     operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/complex:400:5: note:   template argument deduction/substitution failed:
a.cc:128:16: note:   mismatched types 'const std::complex<_Tp>' and 'int'
  128 |     if(n&1)t=t*a;
      |                ^
/usr/include/c++/14/complex:409:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)'
  409 |     operator*(const complex<_Tp>& __x, const _Tp& __y)
      |     ^~~~~~~~
/usr/include/c++/14/complex:409:5: note:   template argument deduction/substitution failed:
a.cc:128:16: note:   mismatched types 'const std::complex<_Tp>' and 'int'
  128 |     if(n&1)t=t*a;
      |                ^
/usr/include/c++/14/complex:418:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)'
  418 |     operator*(const _Tp& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/complex:418:5: note:   template argument deduction/substitution failed:
a.cc:128:16: note:   'const mint' {aka 'const modint<1000000007>'} is not derived from 'const std::complex<_Tp>'
  128 |     if(n&1)t=t*a;
      |                ^