#include <bits/stdc++.h>
using namespace std;
const int N6 = 1e6 + 6, N3 = 1e3 + 6, oo = 1e9 + 9, base = 1e9 + 7;
const long long ool = 1e18 + 9;
int n;
long long a[11], c[111][111], d[111][111];
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i <= 9; ++i) {
    cin >> a[i];
  }
  c[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= i; ++j) {
      c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % base;
    }
  }
  for (int i = a[9]; i <= n; ++i) {
    d[9][i] = 1;
  }
  for (int i = 8; i >= 0; --i) {
    for (int j = 0; j <= n; ++j) {
      for (int k = a[i]; k <= j; ++k) {
        d[i][j] += (d[i + 1][j - k] * c[j - (!i)][k]) % base;
        d[i][j] %= base;
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    ans += d[0][i];
    ans %= base;
  }
  cout << ans << "\n";
  return 0;
}
