#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
int n, m;
pair<int, int> a[N];
void init() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i].first), a[i].second = i;
}
bool _NO() {
  sort(a + 1, a + 1 + n);
  int S = 0;
  for (int i = 1; i <= n; ++i) S += a[i].first;
  return m <= 0 || S < m || (m == 1 && a[1].first != 1) ||
         (n == 1 && a[1].first > m);
}
void Gans() {
  puts("Yes");
  if (m <= a[1].first) {
    printf("%d", a[1].second);
    if (m > 1) --a[2].first;
    for (int i = 2; i <= n; ++i)
      for (int j = 1; j <= a[i].first * 2; ++j) printf(" %d", a[i].second);
    printf(" %d", a[1].second);
    if (m == 1) return;
    if (a[2].first >= 0) {
      printf(" %d", a[2].second);
      for (int i = 1; i <= a[1].first + 1 - m; ++i)
        printf(" %d %d", a[1].second, a[1].second);
      printf(" %d", a[2].second);
      m -= 2;
    } else
      --m;
    for (int i = 1; i <= m; ++i) printf(" %d %d", a[1].second, a[1].second);
  } else {
    int S = 0, k, e;
    for (k = 1; k <= n && S <= m; ++k) S += a[k].first;
    printf("%d", a[1].second);
    if (S > m) --k;
    e = a[k].first - (S - m), a[k].first = S - m;
    for (int i = k; i <= n; ++i)
      for (int j = 1; j <= a[i].first; ++j)
        printf(" %d %d", a[i].second, a[i].second);
    a[k].first = e;
    printf(" %d", a[1].second), --a[1].first;
    for (int i = 1; i <= k; ++i)
      for (int j = 1; j <= a[i].first; ++j)
        printf(" %d %d", a[i].second, a[i].second);
  }
  puts("");
}
int main() {
  init();
  if (_NO())
    puts("No");
  else
    Gans();
  return 0;
}
