#include #define rep(i, a, n) for(int i = a; i < n; i++) #define repp(i, n) rep(i, 0, n) #define repb(i, a, b) for(int i = a; i >= b; i--) #define all(a) a.begin(), a.end() #define int long long using namespace std; typedef pair P; const int mod = 1e9 + 7; int n; typedef long long ll; ll mod_pow(ll x,ll n){ if(n==0) return 1; ll res=mod_pow(x*x%mod,n/2); if(n&1) res=res*x%mod; return res; } ll fact[2000010]; ll get_nCk(ll n,ll k,ll mpd){ fact[0]=1; for(int i=1;i<200010;i++) fact[i]=fact[i-1]*i%mod; return fact[n]*mod_pow(fact[k],mod-2)%mod*mod_pow(fact[n-k],mod-2)%mod; } signed main(){ cin >> n; vector h; int a, sum = 0, cnt = 0; while(cin >> a){ sum += a; cnt++; } int ans = 0; int r = n - (sum + cnt - 1); if(sum == 0) cout << 1 << endl; else if(r < 0) cout << "NA" << endl; else{ ans = get_nCk(r + cnt, cnt, mod); cout << ans << endl; } }