#include <bits/stdc++.h>
using namespace std;
const int Maxn = 210, Mod = 1e9 + 7;
int a[12];
int n;
long long c[Maxn][Maxn];
void getC() {
  c[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    c[i][i] = c[i][0] = 1;
    for (int j = 1; j < i; ++j) {
      c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
      c[i][j] %= Mod;
    }
  }
}
long long dp[12][Maxn];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < 10; ++i) scanf("%d", &a[i]);
  getC();
  for (int i = a[9]; i <= n; ++i) dp[9][i] = 1;
  for (int i = 8; i >= 0; --i) {
    for (int j = a[i]; j <= n; ++j) {
      for (int k = 0; k <= n; ++k) {
        if (j + k > n) break;
        if (i)
          dp[i][j + k] = (dp[i][j + k] + dp[i + 1][k] * c[j + k][j]) % Mod;
        else if (j + k != 0)
          dp[i][j + k] = (dp[i][j + k] + dp[i + 1][k] * c[j + k - 1][j]) % Mod;
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i <= n; ++i) {
    ans = (ans + dp[0][i]) % Mod;
  }
  printf("%d\n", (int)ans);
  return 0;
}
