#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long dx[2] = {1, 0};
const long long dy[2] = {0, 1};
const long long MAX = 300;
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long n, m, x, y, k, Q, ans;
string second;
int a[11];
int dp[110][11];
int c[1010][1010];
int add(int x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
  return x;
}
int mul(int a, int b) { return (a % MOD * b % MOD) % MOD; }
void build() {
  c[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    c[i][0] = 1;
    for (int j = 1; j <= n; ++j) c[i][j] = add(c[i - 1][j], c[i - 1][j - 1]);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  build();
  for (int i = 0; i < 10; ++i) cin >> a[i];
  for (int j = 0; j <= n; ++j) dp[j][9] = (a[9] <= j);
  for (int j = 8; j > 0; --j)
    for (int i = 0; i <= n; ++i)
      for (int k = a[j]; k <= i; ++k)
        dp[i][j] = add(dp[i][j], mul(dp[i - k][j + 1], c[i][k]));
  for (int j = 0; j <= n; ++j)
    for (int i = a[0]; i <= j; ++i)
      dp[j][0] = add(dp[j][0], mul(dp[j - i][1], c[j - 1][i]));
  ans = 0;
  for (int i = 1; i <= n; ++i) ans = add(ans, dp[i][0]);
  cout << ans << '\n';
  return 0;
}
