#include <bits/stdc++.h>
using namespace std;
inline long long labs(long long a) { return a < 0 ? (-a) : a; }
template <typename T>
inline T sqr(T x) {
  return x * x;
}
const int MAXN = 102;
const int MAXA = 10;
long long dp[MAXA + 1][2][MAXN][MAXN];
const long long MOD = 1000000007;
long long cnk[MAXN][MAXN];
int main() {
  int n;
  cin >> n;
  vector<int> cnts(MAXA + 1, 0);
  for (int(i) = 0; (i) < (MAXA); (i)++) {
    cin >> cnts[i];
  }
  reverse((cnts).begin(), (cnts).end());
  fill(&dp[0][0][0][0], &dp[0][0][0][0] + (MAXA + 1) * 2 * MAXN * MAXN, 0);
  fill(&cnk[0][0], &cnk[0][0] + MAXN * MAXN, 0);
  cnk[0][0] = 1;
  for (int i = 1; i < MAXN; i++) {
    cnk[i][0] = 1;
    for (int j = 1; j < MAXN; j++) {
      cnk[i][j] = (cnk[i - 1][j] + cnk[i - 1][j - 1]) % MOD;
    }
  }
  for (int(i) = 0; (i) < (MAXN); (i)++) {
    dp[0][1][i][0] = 1;
  }
  for (int a = 1; a < MAXA; a++) {
    for (int i = 0; i <= n; i++) {
      for (int j = 0; j <= i; j++) {
        for (int k = cnts[a]; k <= j; k++) {
          dp[a][0][i][j] +=
              +(dp[a - 1][0][i][j - k] * cnk[i - (j - k)][k]) % MOD;
          if (k > 0 && j - k < i) {
            dp[a][0][i][j] +=
                +(dp[a - 1][1][i][j - k] * cnk[i - (j - k) - 1][k - 1]) % MOD;
          }
          dp[a][0][i][j] %= MOD;
          if (j - k < i) {
            dp[a][1][i][j] +=
                +(dp[a - 1][1][i][j - k] * cnk[i - (j - k) - 1][k]) % MOD;
          }
          dp[a][1][i][j] %= MOD;
        }
      }
    }
  }
  for (int i = 0; i <= n; i++) {
    int a = MAXA;
    int j = i;
    for (int k = cnts[a]; k <= j; k++) {
      dp[a][0][i][j] += +(dp[a - 1][0][i][j - k] * cnk[i - (j - k)][k]) % MOD;
      dp[a][0][i][j] %= MOD;
    }
  }
  long long res = 0;
  for (int(i) = 0; (i) < (n + 1); (i)++) {
    res += dp[MAXA][0][i][i];
    res %= MOD;
  }
  cout << res << endl;
  return 0;
}
