#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target( \
    "fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("unroll-loops")
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << '{';
  string sep;
  for (const auto &x : v) os << sep << x, sep = ", ";
  return os << '}';
}
template <typename T, size_t size>
ostream &operator<<(ostream &os, const array<T, size> &arr) {
  os << '{';
  string sep;
  for (const auto &x : arr) os << sep << x, sep = ", ";
  return os << '}';
}
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << ' ' << H;
  debug_out(T...);
}
const int MOD = 1e9 + 7;
const int MAX_N = 1e2 + 5;
const int D = 10;
int arr[MAX_N], dp[MAX_N][D], C[MAX_N][MAX_N];
int add(int a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
  if (a < 0) a += MOD;
  return a;
}
int mult(int a, int b) {
  long long res = 1LL * a * b;
  if (res >= MOD) res %= MOD;
  return res;
}
int solve(int restantes, int digito) {
  if (restantes == 0) {
    return digito > 10 ? 1 : arr[digito] > 0 ? 0 : solve(0, digito + 1);
  }
  if (digito >= 10) {
    return 0;
  }
  int &res = dp[restantes][digito];
  if (~res) {
    return res;
  }
  res = 0;
  for (int i = max(0, arr[digito]); i <= restantes; i++) {
    res = add(res, mult(C[restantes][i], solve(restantes - i, digito + 1)));
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  C[0][0] = 1;
  C[1][0] = C[1][1] = 1;
  for (int i = 2; i < MAX_N; i++) {
    C[i][0] = 1;
    for (int j = 1; j < MAX_N; j++) {
      C[i][j] = add(C[i - 1][j], C[i - 1][j - 1]);
    }
  }
  int n;
  cin >> n;
  const int d = 10;
  int s = 0;
  for (int i = 0; i < d; i++) {
    cin >> arr[i];
    s += arr[i];
  }
  int ans = 0;
  for (int i = max(1, s); i <= n; i++) {
    for (int primeiro = 1; primeiro < d; primeiro++) {
      memset(dp, -1, sizeof(dp));
      --arr[primeiro];
      ans = add(ans, solve(i - 1, 0));
      ++arr[primeiro];
    }
  }
  cout << ans << '\n';
  return 0;
}
