#include int main() { long long int m; scanf("%lld", &m); long long int *h = new long long int[m]; long long int i = 0; long long int sum = 0; while ((scanf("%d", &h[i])) == '\n') { sum += h[i]; i++; } long long int num = m - sum; num = num - i + 1; if (num < 0) { printf("NA\n"); } else if (num == 0) { printf("1\n"); } else { long long int fact1 = 1, fact2 = 1, fact3 = 1; for (long long int j = 1; j <= num + i; j++) { fact1 *= j; } for (long long int j = 1; j <= i; j++) { fact2 *= j; } for (long long int j = 1; j <= num; j++) { fact3 *= j; } printf("%d\n", (fact1 / (fact2 * fact3)) % 1000000007); } return 0; }