#include <bits/stdc++.h>
using namespace std;
template <class L, class R>
ostream& operator<<(ostream& cout, pair<L, R> P) {
  return cout << '(' << P.first << ',' << P.second << ')';
}
template <class T>
ostream& operator<<(ostream& cout, vector<T> V) {
  cout << "[ ";
  for (auto v : V) cout << v << ' ';
  return cout << ']';
}
long long n;
long long inp[10];
long long c[200][200];
long long dp[200][200];
bool done[200][200];
long long f(long long len, long long mini) {
  if (done[len][mini] == 1) {
    return dp[len][mini];
  }
  if (mini == 9) {
    return (len >= inp[9]);
  }
  done[len][mini] = 1;
  if (mini == 0) {
    for (long long i = inp[0]; i < len; ++i) {
      dp[len][mini] += c[len - 1][i] * f(len - i, 1);
      dp[len][mini] %= 1000000007;
    }
  } else {
    for (long long i = inp[mini]; i <= len; ++i) {
      dp[len][mini] += c[len][i] * f(len - i, mini + 1);
      dp[len][mini] %= 1000000007;
    }
  }
  return dp[len][mini];
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  for (long long n = 0; n < 200; ++n) {
    for (long long k = 0; k < 200; ++k) {
      done[n][k] = 0;
      dp[n][k] = 0;
      if (k > n) {
        c[n][k] = 0;
        continue;
      }
      if (n == k | k == 0) {
        c[n][k] = 1;
      } else {
        c[n][k] = (c[n - 1][k] + c[n - 1][k - 1]) % 1000000007;
      }
    }
  }
  cin >> n;
  for (long long i = 0; i < 10; ++i) {
    cin >> inp[i];
  }
  long long ans = 0;
  for (long long len = 0; len <= n; ++len) {
    ans += f(len, 0);
    ans %= 1000000007;
  }
  cout << ans << "\n";
}
