#include using namespace std; const int MOD = 1e9 + 7; struct CombinationMod { long long mod, size; vector< long long > fact; vector< long long > inv; void make_fact() { fact[0] = 1; for(int i = 1; i < size; i++){ fact[i] = fact[i-1] * i % mod; } } void make_inv() { inv[0] = inv[1] = 1; for(int i = 2; i < size; i++){ inv[i] = inv[mod % i] * (mod - mod / i) % mod; } for(int i = 2; i < size; i++){ inv[i] = inv[i-1] * inv[i] % mod; } } CombinationMod(int mod, int size = 10000000) : mod(mod), size(size+1) { fact.resize(size); inv.resize(size); make_fact(); make_inv(); } long long nCr(long long n, long long k) { if(k==0 || n==k) return 1; long long ret = fact[n] * inv[k] % mod * inv[n-k] % mod; return ret; } }; int M, K; int H[10000000]; int main() { scanf("%d", &M); while(~scanf("%d", &H[K])) ++K; long long ALL = accumulate(H, H + K, 0LL); CombinationMod c(MOD); if(K == 1 && H[0] == 0) cout << 1 << endl; else if(M - ALL + 1 < K) cout << "NA" << endl; else cout << c.nCr(M - ALL + 1, K) << endl; }