#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int M = 1000000007;
int n, l, A[100], minm = INT_MAX;
int dp[100002][2];
bool game(int sum, int turn) {
  if (sum < 0) {
    return 0;
  }
  if (dp[sum][turn] != -1) {
    if (dp[sum][turn]) return 0;
    return 1;
  }
  for (int i = 0; i < n; i++)
    if (sum - A[i] == 0 || game(sum - A[i], (turn + 1) % 2)) dp[sum][turn] = 1;
  cout << sum << "-" << turn << ":" << dp[sum][turn] << " ";
  if (dp[sum][turn] > 0) return 0;
  dp[sum][turn] = 0;
  return 1;
}
int main() {
  cin >> n >> l;
  memset(dp, -1, sizeof(dp));
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    minm = min(minm, A[i]);
  }
  game(l, 0);
  cout << dp[l][0];
}
