#include<bits/stdc++.h>
using namespace std;
const int N = 2e3+100;
const int P = 1e9+7;
#define fr(i,a,b) for(int i = a;i <= b; ++i)
#define nfr(i,a,b) for(int i = a;i >= b; --i)

int a[N],b[N];
int n,m;

inline int pow_mod(int x,int k){
   int res = 1,base = x;
   while(k){
      if(k&1)res = 1LL*res*base%P;
      k >>= 1; base = 1LL*base*base%P;
   }
   return res;
}

inline int c(int x,int y){
   int ret = 1;
   nfr(i,y,1)ret = 1LL*ret*pow_mod(i,P-2)%P;
   nfr(i,x,x-y+1)ret = 1LL*ret*i%P;
   return ret;
}

int main(){
   scanf("%d%d",&n,&m);
   int sum = 0;
   fr(i,1,n){
      scanf("%d",a+i);
      sum += a[i];
   }
   printf("%d\n",c(m+n,sum+n));
   return 0;
}

#include <bits/stdc++.h>
using namespace std;
int gi() {
	int res = 0, w = 1;
	char ch = getchar();
	while (ch != '-' && !isdigit(ch)) ch = getchar();
	if (ch == '-') w = -1, ch = getchar();
	while (isdigit(ch)) res = res * 10 + ch - '0', ch = getchar();
	return res * w;
}
const int MAX_N = 4e5 + 5;
int N, a[MAX_N];
long long ans;
int main () {
#ifndef ONLINE_JUDGE
    freopen("cpp.in", "r", stdin);
#endif
	N = gi();
	for (int i = 1; i <= N << 1; i++) a[i] = gi();
	priority_queue<int, vector<int>, greater<int> > q;
	for (int i = 1; i <= N; i++)
		q.push(a[N - i + 1]), q.push(a[N + i]), q.pop();
	while (!q.empty()) ans += q.top(), q.pop();
	printf("%lld\n", ans);
    return 0;
}