#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int n;
int a[10];
long long nCr[105][105];
void combin() {
  for (int i = 0; i <= 100; i++) {
    for (int j = 0; j <= i; j++) {
      if (j == 0 || j == i) {
        nCr[i][j] = 1LL;
      } else {
        nCr[i][j] = nCr[i - 1][j] + nCr[i - 1][j - 1];
        nCr[i][j] %= MOD;
      }
    }
  }
  return;
}
long long memo[15][105];
long long dp(int cur, int pan) {
  long long ans = 0LL;
  if (cur >= 10) {
    if (pan == 0) {
      return 1LL;
    } else
      return 0LL;
  }
  if (memo[cur][pan] != -1) return memo[cur][pan];
  if (cur == 0) {
    for (int i = 0; i <= pan - 1 - a[cur]; i++) {
      ans += (nCr[pan - 1][i + a[cur]] * dp(cur + 1, pan - i - a[cur])) % MOD;
      ans %= MOD;
    }
  } else {
    for (int i = 0; i <= pan - a[cur]; i++) {
      ans += nCr[pan][i + a[cur]] * dp(cur + 1, pan - i - a[cur]);
      ans %= MOD;
    }
  }
  return memo[cur][pan] = ans;
}
int main() {
  combin();
  scanf("%d", &n);
  memset(memo, -1, sizeof(memo));
  int sisa = n;
  for (int i = 0; i < 10; i++) {
    scanf("%d", &a[i]);
    sisa -= a[i];
  }
  if (sisa < 0) {
    printf("0\n");
  } else {
    long long ans = 0LL;
    for (int i = 0; i <= sisa; i++) {
      ans += dp(0, n - i);
    }
    printf("%lld\n", ans % MOD);
  }
  return 0;
}
