#include <bits/stdc++.h>
using namespace std;
const int mod = (int)1e9 + 7;
const int N = 105;
long long C[N][N];
void OP(int msk) {
  for (int i = 0; i < 10; i++, msk >>= 1) cout << (msk & 1);
  cout << " ";
}
int main() {
  for (int i = 0; i < N; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= i; j++)
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
  }
  int n, a[11];
  static long long dp[N][1 << 11];
  while (cin >> n) {
    for (int i = 0; i < 10; i++) {
      cin >> a[i];
    }
    dp[0][0] = 1;
    for (int i = 0; i <= n; i++) {
      for (int msk = 1; msk < (1 << 10); msk++) {
        long long &t = dp[i][msk];
        t = 0;
        for (int p = 0; p < 10; p++)
          if ((1 << p) & msk) {
            long long s = 0;
            for (int j = 0; j <= i - a[p]; j++) {
              if (p)
                s += C[i][i - j] * dp[j][msk ^ (1 << p)];
              else
                s += i ? C[i - 1][i - j] * dp[j][msk ^ (1 << p)] : 0;
              s %= mod;
              if (s) {
              }
            }
            t = (t + s) % mod;
            break;
          }
      }
    }
    long long ans = 0;
    for (int i = 1; i <= n; i++) ans = (ans + dp[i][(1 << 10) - 1]) % mod;
    cout << ans << endl;
  }
}
