#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long double PI = 4 * atan((long double)1);
const long long mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long tt = 1;
  while ((tt)--) {
    long long n, k;
    cin >> n >> k;
    map<long long, set<long long>> mp;
    vector<long long> a(n);
    for (long long i = 0; i < (n); ++i) cin >> a[i], mp[a[i]].insert(i + 1);
    sort(a.begin(), a.end());
    vector<long long> Ans;
    for (long long i = 0; i < (n); ++i) {
      if (a[i] <= k) {
        set<long long> use = mp[a[i]];
        auto p = *use.rbegin();
        Ans.push_back(p);
        k -= a[i];
        mp[a[i]].erase(p);
      } else {
        break;
      }
    }
    cout << (long long)(Ans).size() << '\n';
    for (auto& i : Ans) cout << i << " ";
  }
}
