#include <bits/stdc++.h>
using namespace std;
template <class Ta, class Tb>
inline Tb cast(Ta a) {
  stringstream ss;
  ss << a;
  Tb b;
  ss >> b;
  return b;
};
const double EPS = 1e-9;
const int INF = 1000000000;
const int MOD = 1000000007;
const int diri[8] = {-1, 0, 1, 0, -1, 1, 1, -1};
const int dirj[8] = {0, 1, 0, -1, 1, 1, -1, -1};
long long cn[110][110];
int fun(int n, vector<int> v) {
  vector<vector<long long> > dp(n + 1, vector<long long>(11, 0));
  dp[0][10] = 1;
  for (int j = 9; j >= 0; --j) {
    for (int i = v[j]; i <= n; ++i) {
      for (int k = v[j]; k <= i; ++k) {
        dp[i][j] = (dp[i][j] + cn[i][k] * dp[i - k][j + 1]) % MOD;
      }
    }
  }
  long long res = 0;
  for (int i = 0; i <= n; ++i) res = (res + dp[i][0]) % MOD;
  return res;
}
void compute_cn() {
  cn[0][0] = 1;
  for (int n = 1; n <= 100; ++n) {
    cn[n][0] = cn[n][n] = 1;
    for (int k = 1; k < n; ++k)
      cn[n][k] = (cn[n - 1][k] + cn[n - 1][k - 1]) % MOD;
  }
}
int main() {
  compute_cn();
  int n;
  cin >> n;
  vector<int> v(10);
  for (int i = 0; i < 10; ++i) cin >> v[i];
  long long res = 0;
  for (int i = 1; i < 10; ++i) {
    if (v[i]) {
      --v[i];
      res = (res + fun(n - 1, v)) % MOD;
      ++v[i];
    } else {
      res = (res + fun(n - 1, v)) % MOD;
    }
  }
  cout << res << endl;
}
