#include <bits/stdc++.h>
inline int Rand() { return (rand() << 16) | rand(); }
using namespace std;
int n, k;
struct Pair {
  int x, p;
} a[100500];
bool cmp(Pair p1, Pair p2) {
  return p1.x < p2.x || (p1.x == p2.x && p1.p < p2.p);
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i].x, a[i].p = i;
  sort(a + 1, a + n + 1, cmp);
  int c = 0, l = 0;
  for (int i = 1; i <= n; i++) {
    if (c + a[i].x <= k)
      l = i, c += a[i].x;
    else
      break;
  }
  cout << l << endl;
  for (int i = 1; i <= l; i++) cout << a[i].p << " ";
  return 0;
}
