#include <bits/stdc++.h>
using namespace std;
int b[10010];
struct NODE {
  int val, x;
} a[10010];
bool cmp(NODE a, NODE b) { return a.val < b.val; }
int main() {
  int n, m, i;
  scanf("%d%d", &n, &m);
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i].val);
    a[i].x = i;
  }
  sort(a + 1, a + 1 + n, cmp);
  for (i = 1; i <= n; i++) {
    b[i] = a[i].val + b[i - 1];
  }
  for (i = 1; b[i] <= m && i <= n; i++)
    ;
  int ans = i - 1;
  printf("%d\n", ans);
  for (i = 1; i <= ans; i++) printf("%d ", a[i].x);
  return 0;
}
