#include <bits/stdc++.h>
using namespace std;
void file_put() {
  freopen("filename.in", "r", stdin);
  freopen("filename.out", "w", stdout);
}
const int N = 1e5 + 5;
int n, w, a[N], s = 0, p = 1e9;
vector<int> ret;
void print() {
  for (auto x : ret) printf("%d ", x);
  printf("\n");
}
int main() {
  scanf("%d%d", &n, &w);
  for (int i = (1); i < (n + 1); i++)
    scanf("%d", &a[i]), s += a[i], p = min(p, a[i]);
  if (w < 1 || w > s) return 0 * printf("No\n");
  if (w == 1) {
    if (p == 1) {
      bool ok = 0;
      int k;
      for (int i = (1); i < (n + 1); i++)
        if (!ok && a[i] == 1)
          ok = 1, k = i;
        else
          for (int kk = (0); kk < (a[i]); kk++)
            ret.push_back(i), ret.push_back(i);
      ret.push_back(k), ret.insert(ret.begin(), k);
      printf("Yes\n");
      print();
      return 0;
    } else
      return 0 * printf("No\n");
  }
  if (n == 1) {
    if (w == a[1]) {
      for (int i = (1); i < (2 * a[1] + 1); i++) ret.push_back(1);
      printf("Yes\n");
      print();
      return 0;
    } else
      return 0 * printf("No\n");
  }
  a[1]--, a[2]--, w -= 2;
  for (int i = n; i && w; i--) {
    int k = min(w, a[i]);
    a[i] -= k, w -= k;
    for (int j = (0); j < (k); j++)
      for (int op = (0); op < (2); op++) ret.push_back(i);
  }
  printf("Yes\n");
  printf("1 ");
  for (int i = (0); i < (a[2]); i++) printf("2 2 ");
  for (int i = (3); i < (n + 1); i++)
    for (int j = (0); j < (a[i]); j++)
      for (int k = (0); k < (2); k++) printf("%d ", i);
  printf("1 2 ");
  for (int i = (0); i < (a[1]); i++) printf("1 1 ");
  printf("2 ");
  print();
  return 0;
}
