#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, f = 0, q = 0, k = 0;
  cin >> n >> m;
  int v[1004];
  vector<int> s;
  vector<int> l;
  pair<int, int> p[1004];
  for (int i = 1; i < n + 1; i++) {
    cin >> v[i];
    p[i] = {v[i], i};
  }
  sort(p + 1, p + n + 1);
  if (m >= p[1].first) {
    q = p[1].first;
    k++;
    l.push_back(p[1].second);
  } else {
    cout << 0;
    return 0;
  }
  for (int i = 2; i <= n; i++) {
    if (q < m && m - q >= p[i].first) {
      q = q + p[i].first;
      k++;
      l.push_back(p[i].second);
    }
  }
  cout << k << endl;
  for (int i = 0; i < k; i++) {
    cout << l[i] << " ";
  }
}
