#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;

// a^n (mod.MOD)を求める。計算量はO(logn)
ll modpow(ll a, ll n, ll MOD = mod) {
    if(n == 0) {
        return 1;
    }
    if(n%2 == 1) {
        return (a * modpow(a, n-1, MOD))%MOD;
    }
    return (modpow(a, n/2, MOD) * modpow(a, n/2, MOD))%MOD;
}

// nCrをO(r)で求める。
ll Comb(ll n, ll r) {
    if(n < r) {
        return 0;
    }
    if(r > n-r) {
        return Comb(n, n-r);
    }
    ll Mul = 1;
    ll Div = 1;
    rep(i, r) {
        Mul *= (n-i);
        Div *= (i+1);
        Mul %= mod;
        Div %= mod;
    }
    ll res = Mul*modpow(Div, mod-2)%mod;
    return res; 
}

int main() {
    ll n, m;
    cin >> n >> m;

    ll s = 0;
    rep(i, n) {
        ll a;
        cin >> a;
        s += a;
    }
    
    out(Comb(n+m, n+s));
    re0;
}
#include <bits/stdc++.h>
using namespace std;

typedef pair<int, int> ii;

int V[400005];
vector<int> A;
vector<int> B;

int main(){
    int N;
    scanf("%d", &N);

    long long ans = 0;
    for(int i = 0; i < 2*N; i ++){
        scanf("%d", &V[i]);
        ans += V[i];
    }

    for(int i = 0; i < N; i ++){
        A.push_back(V[i]);
    }

    for(int i = N; i < 2*N; i ++){
        B.push_back(V[i]);
    }

    reverse(A.begin(), A.end());

    priority_queue<int, vector<int>, greater<int> > pq;

    for(int i = 0; i < N; i ++){
        pq.push(A[i]);
        pq.push(B[i]);

        assert(!pq.empty());
        ans -= pq.top();
        pq.pop();
    }

    printf("%lld\n", ans);
    return 0;
}

