#include <bits/stdc++.h>
using namespace std;
const double pi = 3.1415926535897932384626433832795;
const int inf = 1e9;
const long long inf2 = 1e18;
const int mod = 1e9 + 7;
void boost() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
const int maxn = 102;
long long ncr[maxn][maxn];
int cnt[11];
vector<vector<long long> > dp(11, vector<long long>(maxn, -1));
long long fun(int e, int rem) {
  if (e == 10) return rem == 0;
  if (dp[e][rem] != -1) return dp[e][rem];
  long long res = 0, c;
  for (int i = cnt[e]; i < rem + 1; ++i) {
    c = (e == 0) ? ncr[rem - 1][i] : ncr[rem][i];
    res = (res + c * fun(e + 1, rem - i)) % mod;
  }
  return dp[e][rem] = res;
}
void solve() {
  for (int i = 0; i < maxn; ++i) {
    ncr[i][0] = ncr[i][i] = 1;
    for (int j = 1; j < i; ++j)
      ncr[i][j] = (ncr[i - 1][j - 1] + ncr[i - 1][j]) % mod;
  }
  int n;
  cin >> n;
  for (int i = 0; i < 10; ++i) {
    cin >> cnt[i];
  }
  long long ans = 0;
  for (int i = 1; i < n + 1; ++i) {
    ans = (ans + fun(0, i)) % mod;
  }
  cout << ans;
  return;
}
int main() {
  boost();
  int tc = 1;
  while (tc--) solve();
  return 0;
}
