#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll> pql;
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define rep2(i, k, n) for(ll i = ll(k); i <= ll(n); i++)
#define rep3(i, n, k) for(ll i = ll(n); i >= ll(k); i--)
#define all(v) (v).begin(), (v).end()
ll mod(ll a, ll b) {if(b == 0) return 0; return (a % b + b) % b;}
bool chmin(ll &a, ll b) {if(b < a) {a = b; return 1;} return 0;}
bool chmax(ll &a, ll b) {if(b > a) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 2e5;
const ld eps = 1e-9;
const char newl = '\n';

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  ll n, t;
  cin >> n >> t;
  vl a(n);
  rep(i, n) cin >> a[i];
  if(n==1) {
    if(a[0]<=t) cout << a[0] << newl;
    else cout << 0 << newl;
    return 0;
  }
  vvl num(2), sum(2);
  rep(i, n) {
    if(i <= n/2) num[0].push_back(a[i]);
    else num[1].push_back(a[i]); 
  }
  vl nums(2);
  rep(i, 2) nums[i] = num[i].size();
  rep(i, 1 << nums[0]) {
    ll tmpsum = 0;
    rep(j, nums[0]) if(i & (1 << j)) tmpsum += a[j];
    if(tmpsum <= t) sum[0].push_back(tmpsum);
  }
  rep(i, 1 << nums[0]) {
    ll tmpsum = 0;
    rep(j, nums[1]) if(i & (1 << j)) tmpsum += a[nums[0]+j];
    if(tmpsum <= t) sum[1].push_back(tmpsum);
  }
  sort(all(sum[0]), greater<ll>());
  sort(all(sum[1]));
  ll ans=0, k=0;
  rep(i, sum[0].size()) {
    rep2(j, k, sum[1].size()-1) {
      ll tmpsum = sum[0][i] + sum[1][j];
      if(tmpsum > t) break;
      else {
        k = j;
        chmax(ans, tmpsum);
      }
    }
  }
  cout << ans << newl;
  return 0;
}
/*  -*- coding: utf-8 -*-
 *
 * e.cc: E - White and Black Balls
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 1000000;
const int MAX_M = 1000000;
const int MOD = 1000000007;

/* typedef */

typedef long long ll;

/* global variables */

int fs[MAX_N + MAX_M + 1], invfs[MAX_N + MAX_M + 1];

/* subroutines */

int powmod(int a, int n) {  // a^n % MOD
  int pm = 1;
  while (n > 0) {
    if (n & 1) pm = (ll)pm * a % MOD;
    a = (ll)a * a % MOD;
    n >>= 1;
  }
  return pm;
}

inline int nck(int n, int k) {  // nCk % MOD
  if (n < k || k < 0) return 0;
  return (ll)fs[n] * invfs[n - k] % MOD * invfs[k] % MOD;
}

void prepare_fracs(int n) {
  fs[0] = invfs[0] = 1;
  for (int i = 1; i <= n; i++) {
    fs[i] = (ll)fs[i - 1] * i % MOD;
    invfs[i] = powmod(fs[i], MOD - 2);
  }
}

/* main */

int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);

  if (n > m + k) { puts("0"); return 0; }

  prepare_fracs(n + m);

  int a = (nck(n + m, n) + MOD - nck(n + m, m + k + 1)) % MOD;
  printf("%d\n", a);
  return 0;
}
