#include <iostream>
#include <algorithm>
using namespace std;

long long md = 1000000007;

long long fp(long long n, long long k)
{
	long long s = 1;
	while (k) {
		if (k & 1) s = (s * n) % md;
		k /= 2; n = (n * n) % md;
	}
	return s;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int n, m; cin >> n >> m;
	int s = n;
	for (int i = 0; i < n; i++) {
		int a; cin >> a;
		s += a;
	}
	int p = n + m;
	long long ns = 1, rs = 1;
	for (int i = 0; i < s; i++) {
		ns = (ns * (p - i)) % md;
		rs = (rs * (i + 1)) % md;
	}
	rs = fp(rs, md - 2);
	cout << (ns * rs) % md << '\n';
	return 0;
}
// Problem: B - 200th ABC-200
// Contest: AtCoder - KYOCERA Programming Contest 2021（AtCoder Beginner Contest 200）
// URL: https://atcoder.jp/contests/abc200/tasks/abc200_b
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// Author: abhidot

#include <bits/stdc++.h>
#define int long long
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define mod 1000000007 //998244353
#define lld long double
#define pii pair<int, int>
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define setbits(x) __builtin_popcountll(x)
#define w(x)  int x; cin>>x; while(x--)
using namespace std;
const long long N=200005, INF=2000000000000000000;

/*------------- Modular exponentiation -------------*/
int power(int a, int b, int p)
    {
        if(a==0)
        return 0;
        int res=1;
        a%=p;
        while(b>0)
        {
            if(b&1)
            res=(res*a)%p;
            b>>=1;
            a=(a*a)%p;
        }
        return res;
    }
	

/*------------- Sieve --------------*/	
vector <int> prime;
bool is_composite[N];

void sieve (int n) {
	fill (is_composite, false);
	for (int i = 2; i < n; ++i) {
		if (!is_composite[i]) prime.push_back (i);
		for (int j = 0; j < prime.size () && i * prime[j] < n; ++j) {
			is_composite[i * prime[j]] = true;
			if (i % prime[j] == 0) break;
		}
	}
}


/*------------ Utitlity function ---------------*/
void print(bool n){
    if(n){
        cout<<"YES";
    }else{
        cout<<"NO";
    }
}


int32_t main()
{
    IOS;
    int n,k;
    cin>>n>>k;
    int cnt=0;
    while(k&&n%200==0){
    	n/=200;
    	k--;
    }
    
    for(int i=0;i<k-1;i+=2){
    	n*=10;
    	n+=2;
    	n/=2;
    }
    string s = to_string(n);
    if(k%2) s+="200";
    cout<<s;
}

// Written by abhidot