#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;
int n, arr[10];
long long int dp[10][101], mod = 1e9 + 7, fac[101];
long long int fast(long long int x, int y) {
  if (y == 0) return 1;
  long long int temp = fast(x, y / 2) % mod;
  if (y % 2 == 1) return x * (temp * temp % mod) % mod;
  return temp * temp % mod;
}
long long int calc(int i, int num) {
  if (num >= n) return 0;
  if (i == 10) return fac[num];
  long long int &ret = dp[i][num];
  if (ret != -1) return ret;
  ret = 0;
  for (int x = arr[i]; x <= n; x++) {
    ret += fast(fac[x], mod - 2) * calc(i + 1, num + x) % mod;
    ret %= mod;
  }
  return ret;
}
int main() {
  cin >> n;
  for (int i = 0; i < 10; i++) cin >> arr[i];
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % mod;
  long long int ans = 0;
  for (int i = 1; i <= 9; i++) {
    memset(dp, -1, sizeof dp);
    arr[i]--;
    ans += calc(0, 0);
    ans %= mod;
    arr[i]++;
  }
  cout << ans << endl;
  return 0;
}
