#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcd(T a, T b) {
  T r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
const double PI = 2 * acos(0.0);
const long double eps = 1e-12;
const int infi = 1e9;
const long long Linfi = (long long)9e18;
const long long MOD = 1000000007;
struct data {
  int val, pos;
  friend bool operator<(data A, data B) { return A.val < B.val; }
};
int n, k;
data a[500005];
void solve() {
  long long sum = 0;
  sort(a + 1, a + n + 1);
  vector<int> V;
  for (int i = 1; i <= n; i++) {
    if (sum + a[i].val <= k) {
      sum += a[i].val;
      V.push_back(a[i].pos);
    }
  }
  cout << V.size() << endl;
  for (int i = 0; i < V.size(); i++) cout << V[i] << " ";
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].val;
    a[i].pos = i;
  }
  solve();
  return 0;
}
