#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 6;
vector<pair<int, int> > w[N];
int dp[3 * N], temp[3 * N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, x;
  cin >> n >> x;
  int a[n + 1];
  for (int i = 1; i <= n; i++) cin >> a[i];
  int dp[x + 1][x + 1];
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = x; j >= 0; j--) {
      for (int k = x; k >= 0; k--) {
        if (j >= a[i]) dp[j][k] |= dp[j - a[i]][k];
        if (j >= a[i] && k >= a[i]) dp[j][k] |= dp[j - a[i]][k - a[i]];
      }
    }
  }
  vector<int> v;
  for (int i = 0; i <= x; i++)
    if (dp[x][i]) v.push_back(i);
  cout << v.size() << '\n';
  for (auto it : v) cout << it << " ";
  return 0;
}
