#include <bits/stdc++.h>
using namespace std;
long long c[200][200], dp[200][200], num[200], answ, n;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < 10; i++) cin >> num[i];
  c[0][0] = 1;
  for (int i = 0; i <= 100; i++)
    for (int j = 0; j <= i; j++)
      if (j == 0)
        c[i][j] = 1;
      else
        c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % 1000000007;
  for (int i = 0; i <= n; i++) {
    if (i < num[9])
      dp[i][9] = 0;
    else
      dp[i][9] = 1;
    for (int q = 9; q >= 1; q--)
      for (int j = num[q]; j <= i; j++)
        dp[i][q] += dp[i - j][q + 1] * c[i][j] % 1000000007;
    for (int j = num[0]; j <= i; j++)
      dp[i][0] += dp[i - j][1] * c[i - 1][j] % 1000000007;
    for (int j = 0; j <= 9; j++) dp[i][j] %= 1000000007;
  }
  answ = 0;
  for (int i = 1; i <= n; i++) answ += dp[i][0] % 1000000007;
  cout << answ % 1000000007 << endl;
  cin.get();
  cin.get();
  return 0;
}
