#include <bits/stdc++.h>
using namespace std;
int w;
int sum = 0;
int value = 0;
vector<int> nums;
vector<int> ans;
struct Saver {
  int index;
  int save;
  Saver(int i) : index(i) {
    ans.push_back(index);
    save = ::value;
  }
  ~Saver() {
    ans.push_back(index);
    ::value = save + 1;
    --nums[index];
  }
};
void spend_to(int i, int dst) {
  int &value = nums[i];
  while (value > dst) {
    Saver s(i);
  }
}
void spend_careful(int i, int dst, int &care) {
  int &value = nums[i];
  while (care > 0 && value > dst) {
    Saver s(i);
    --care;
  }
}
bool solve() {
  if (nums.size() == 1) {
    if (nums[0] == w) {
      spend_to(0, 0);
      return true;
    } else
      return false;
  } else if (w == 1) {
    vector<int>::iterator id_1 = std::find(nums.begin(), nums.end(), 1);
    if (id_1 != nums.end()) {
      int i1 = id_1 - nums.begin();
      {
        Saver s(i1);
        for (int i = 0; i < nums.size(); i++)
          if (i != i1) spend_to(i, 0);
      }
      return true;
    } else
      return false;
  } else {
    if (sum < w || w < 2) return false;
    int need = w - 2;
    int need0 = min(nums[0] - 1, need);
    need -= need0;
    int to_spend = sum - nums[0] - need - 1;
    {
      Saver s(0);
      spend_careful(1, 1, to_spend);
      for (int i = 2; i < nums.size(); ++i) spend_careful(i, 0, to_spend);
    }
    {
      Saver s(1);
      spend_to(0, need0);
    }
    for (int i = 0; i < nums.size(); i++) spend_to(i, 0);
    return true;
  }
}
int main() {
  int n;
  scanf("%d%d", &n, &w);
  nums.resize(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &nums[i]);
    sum += nums[i];
  }
  if (solve()) {
    printf("Yes\n");
    for (int i = 0; i < ans.size(); i++) {
      printf("%d ", ans[i] + 1);
    }
    printf("\n");
    assert(value == w);
  } else {
    printf("No\n");
  }
  return 0;
}
