#include <bits/stdc++.h>
using namespace std;
vector<int> solve(vector<int> r, int w) {
  int n = int(r.size());
  int rsum = 0;
  for (int i = 0; i < n; ++i) {
    rsum += r[i];
  }
  if (w < 1 || w > rsum) {
    return vector<int>();
  } else if (w == 1) {
    int ind = -1;
    for (int i = 0; i < n && ind == -1; ++i) {
      if (r[i] == 1) ind = i;
    }
    if (ind == -1) {
      return vector<int>();
    } else {
      vector<int> sol;
      sol.push_back(ind);
      --r[ind];
      for (int i = 0; i < n; ++i) {
        for (int j = 0; j < r[i]; ++j) {
          sol.push_back(i);
          sol.push_back(i);
        }
      }
      sol.push_back(ind);
      return sol;
    }
  } else if (n == 1) {
    if (w != rsum) {
      return vector<int>();
    } else {
      return vector<int>(2 * r[0], 0);
    }
  } else {
    int waste = rsum - w;
    vector<int> sol;
    sol.push_back(0);
    --r[0];
    for (; r[1] > 1 && waste > 0;) {
      sol.push_back(1);
      sol.push_back(1);
      --r[1];
      --waste;
    }
    sol.push_back(0);
    sol.push_back(1);
    --r[1];
    for (int i = 0; i < n && waste > 0; ++i) {
      for (; r[i] > 0 && waste > 0;) {
        sol.push_back(i);
        sol.push_back(i);
        --r[i];
        --waste;
      }
    }
    sol.push_back(1);
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < r[i]; ++j) {
        sol.push_back(i);
        sol.push_back(i);
        --waste;
      }
    }
    return sol;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, w;
  cin >> n >> w;
  vector<int> r(n);
  for (int i = 0; i < n; ++i) cin >> r[i];
  vector<int> sol = solve(r, w);
  if (int(sol.size()) == 0) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
    for (int i = 0; i < int(sol.size()); ++i) {
      if (i > 0) cout << " ";
      cout << sol[i] + 1;
    }
    cout << endl;
  }
}
