#include <bits/stdc++.h>
using namespace std;
int n, k;
bitset<501> dp[501];
int main() {
  scanf("%d%d", &n, &k);
  dp[k][0] = 1;
  for (int i = 0, x; i < n; ++i) {
    scanf("%d", &x);
    for (int j = 0; j <= k - x; j++) dp[j] |= dp[j + x] | (dp[j + x] << x);
  }
  printf("%d\n", dp[0].count());
  for (int i = 0; i <= k; i++)
    if (dp[0][i]) printf("%d ", i);
  return 0;
}
