#include <bits/stdc++.h>
using namespace std;
int arr1[10000], arr2[10000], arr3[10000];
int max(int a, int b) {
  if (a >= b)
    return a;
  else
    return b;
}
void merge_arrays(int n1, int n2) {
  int n = 0, i = 0, j = 0;
  int maxindex = max(n1, n2);
  while (i < maxindex || j < maxindex) {
    if (arr1[i] <= arr2[j]) {
      arr3[n] = arr1[i];
      i++;
      ++n;
    } else if (arr1[i] > arr2[j]) {
      arr3[n] = arr2[j];
      j++;
      ++n;
    }
  }
  printf("%d", n);
  printf("After merging two arrays :-  \n");
  for (int i = 0; i < n; i++) {
    printf("%d ", arr3[i]);
  }
}
int main() {
  int n, k;
  cin >> n >> k;
  vector<pair<int, int>> a(n);
  for (int i = 0; i < n; ++i) {
    int temp;
    cin >> temp;
    a[i].second = i;
    a[i].first = temp;
  }
  sort(a.begin(), a.end());
  if (k < a[0].first) {
    cout << 0 << endl;
    exit(0);
  }
  int sum = 0, count = 0;
  vector<int> ans;
  for (int i = 0; i < n; ++i) {
    sum += a[i].first;
    if (sum > k) {
      break;
    }
    ans.push_back(a[i].second);
    count += 1;
  }
  cout << count << endl;
  for (int i : ans) {
    cout << (i + 1) << " ";
  }
  cout << endl;
}
