#include <bits/stdc++.h>
using namespace std;
long long c[123][123], dp[13][123];
int cs = 1e9 + 7;
void zy(long long &a, long long b) {
  a += b;
  a %= cs;
}
int main() {
  c[0][0] = 1;
  for (int i = 0; i < 110; i++)
    for (int q = 0; q <= i; q++)
      c[i][q] %= cs, c[i + 1][q] += c[i][q], c[i + 1][q + 1] += c[i][q];
  int m = 10, n, a[12];
  while (cin >> n) {
    int s = 0;
    for (int i = 0; i < m; i++) cin >> a[i], s += a[i];
    if (s > n) {
      cout << 0 << endl;
      continue;
    }
    if (n == 1 && a[0] == 1) {
      cout << 1 << endl;
      continue;
    }
    long long da = 0;
    for (int z = 1; z < 10; z++) {
      int fk = 0;
      if (a[z]) fk = 1;
      a[z] -= fk;
      memset(dp, 0, sizeof(dp));
      for (int i = 0; i < n; i++) dp[0][i] = 1;
      for (int i = 0; i < m; i++)
        for (int q = 0; q < n; q++)
          for (int j = a[i]; j < n; j++)
            if (j <= q) zy(dp[i + 1][q - j], dp[i][q] * c[q][j]);
      zy(da, dp[m][0]);
      a[z] += fk;
    }
    cout << da << endl;
  }
}
