#include <bits/stdc++.h>
using namespace std;
int n;
int a[10];
int c[105][105], dp[105][105];
inline void update(int& ret, long long v) {
  v %= 1000000007;
  ret = (ret + v) % 1000000007;
}
int solve(int m) {
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  for (int i = 0; i < 10; ++i) {
    int p = m - (i == 0);
    for (int j = 0; j <= p; ++j)
      if (dp[i][j])
        for (int k = a[i]; k + j <= p; ++k)
          update(dp[i + 1][j + k], (long long)dp[i][j] * c[p - j][k]);
  }
  return dp[10][m];
}
int main() {
  for (int i = 0; i < 105; ++i) c[i][0] = 1;
  for (int i = 1; i < 105; ++i)
    for (int j = 1; j <= i; ++j)
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % 1000000007;
  scanf("%d", &n);
  for (int i = 0; i < 10; ++i) scanf("%d", &a[i]);
  int ans = 0;
  for (int i = 1; i <= n; ++i) update(ans, solve(i));
  printf("%d\n", ans);
  return 0;
}
