#include <bits/stdc++.h>
using namespace std;
const int N = 200;
const long long MOD = 1000 * 1000 * 1000LL + 7;
long long d[N], c[N][N], a[N];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < 10; i++) cin >> a[i];
  c[0][0] = 1;
  for (int i = 1; i <= 100; i++) {
    c[0][i] = 1;
    for (int j = 1; j <= i; j++)
      c[j][i] = (c[j - 1][i - 1] + c[j][i - 1]) % MOD;
  }
  d[0] = 1;
  for (int i = 9; i >= 0; i--) {
    for (int j = n; j >= 0; j--) {
      long long tmp(0);
      for (int k = j - a[i]; k >= 0; k--) {
        if (i || j) tmp = (tmp + d[k] * c[j - k][j - (i == 0)]) % MOD;
      }
      d[j] = tmp;
    }
  }
  long long ans(0);
  for (int i = n; i >= 0; i--) ans = (ans + d[i]) % MOD;
  cout << ans << endl;
  return 0;
}
