#include <bits/stdc++.h>
using namespace std;
const int N = 1100;
int t[N];
const string no = "No";
const string yes = "Yes";
void wypisz(vector<int> v) {
  for (int i = 0; i < ((int)v.size()); ++i) {
    if (i) printf(" ");
    printf("%d", v[i] + 1);
  }
  puts("");
}
void jedynka(int ktory, int n) {
  printf("%s\n", yes.c_str());
  vector<int> v;
  v.push_back(ktory);
  for (int i = 0; i < (n); ++i)
    if (i != ktory)
      for (int j = 0; j < (2 * t[i]); ++j) v.push_back(i);
  v.push_back(ktory);
  wypisz(v);
}
int main() {
  int n, w;
  scanf("%d %d", &n, &w);
  int suma = 0;
  for (int i = 0; i < (n); ++i) {
    scanf("%d", t + i);
    suma += t[i];
  }
  if (n == 1) {
    if (w != t[0])
      printf("%s\n", no.c_str());
    else {
      printf("%s\n", yes.c_str());
      vector<int> v(2 * t[0], 0);
      wypisz(v);
    }
  } else {
    if (w <= 0 || w > suma) {
      printf("%s\n", no.c_str());
      return 0;
    } else if (w == 1) {
      int ktory = -1;
      for (int i = 0; i < (n); ++i)
        if (t[i] == 1) ktory = i;
      if (ktory == -1) {
        printf("%s\n", no.c_str());
        return 0;
      } else {
        jedynka(ktory, n);
      }
    } else {
      if (w == suma) {
        vector<int> v;
        for (int i = 0; i < (n); ++i)
          for (int j = 0; j < (2 * t[i]); ++j) v.push_back(i);
        printf("%s\n", yes.c_str());
        wypisz(v);
        return 0;
      }
      vector<int> v;
      while (n > 2 && w > 2) {
        v.push_back(n - 1);
        v.push_back(n - 1);
        t[n - 1]--;
        w--;
        if (t[n - 1] == 0) n--;
      }
      if (n == 2 && w > 2) {
        while (w > 2) {
          for (int i = 0; i < (2); ++i)
            if (t[i] > 1) {
              w--;
              v.push_back(i);
              v.push_back(i);
              t[i]--;
              break;
            }
        }
      }
      assert(n >= 2 && w == 2);
      int ktory = -1;
      for (int i = 0; i < (n); ++i)
        if (t[i] > 1) {
          ktory = i;
        }
      if (ktory == -1) {
        v.push_back(0);
        v.push_back(0);
        v.push_back(1);
        for (int i = (2); i <= (n - 1); ++i)
          for (int foo = 0; foo < (2); ++foo) v.push_back(i);
        v.push_back(1);
        printf("%s\n", yes.c_str());
        wypisz(v);
      } else {
        int drugi = (ktory != 0) ? 0 : 1;
        v.push_back(ktory);
        for (int i = 0; i < (n); ++i)
          if (i != ktory && i != drugi)
            for (int j = 0; j < (2 * t[i]); ++j) v.push_back(i);
        for (int j = 0; j < (2 * (t[drugi] - 1)); ++j) v.push_back(drugi);
        v.push_back(ktory);
        v.push_back(drugi);
        for (int j = 0; j < (2 * (t[ktory] - 1)); ++j) v.push_back(ktory);
        v.push_back(drugi);
        printf("%s\n", yes.c_str());
        wypisz(v);
      }
    }
  }
  return 0;
}
