#include <bits/stdc++.h>
using namespace std;
int t, n, m, tmp, res, cnt, a, b, c, d, p, q, x, y, sz, d256, d32;
bool srt(pair<int, int> &a, pair<int, int> &b) { return (a.second > b.second); }
vector<pair<int, int>> vp;
vector<int> v;
int idx[4] = {0, 1, -1, 0};
int idy[4] = {1, 0, 0, -1};
char arr[51][51];
string s[11], l, tt;
string vwl = "AEOUIY";
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &t);
    if (t <= m) vp.push_back(make_pair(t, i));
  }
  sort((vp).begin(), (vp).end());
  a = vp.size();
  if (a == 0) {
    puts("0");
    exit(0);
  } else {
    for (int i = 0; i < a; ++i) {
      if (vp[i].first <= m) {
        m -= vp[i].first;
        cnt++;
        v.push_back(vp[i].second);
      } else {
        break;
      }
    }
  }
  printf("%d\n", cnt);
  for (int i = 0; i < cnt; ++i) {
    printf("%d ", v[i]);
  }
  return 0;
}
