#include <bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(), (a).end()
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
using ld = long double;
template<typename T1, typename T2> bool chkmin(T1& x, T2 y) {
  return y < x ? (x = y, true) : false;
}
template<typename T1, typename T2> bool chkmax(T1& x, T2 y) {
  return y > x ? (x = y, true) : false;
}
void debug_out() {
  cerr << endl;
}
template<typename T1, typename... T2> void debug_out(T1 A, T2... B) {
  cerr << ' ' << A;
  debug_out(B...);
}
template<typename T> void mdebug_out(T* a, int n) {
  for (int i = 0; i < n; ++i) {
    cerr << a[i] << ' ';
  }
  cerr << endl;
}
#ifdef DEBUG
  #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
  #define mdebug(a, n) cerr << #a << ": ", mdebug_out(a, n)
#else
  #define debug(...) 1337
  #define mdebug(a, n) 1337
#endif

const int N = 1000006;
int n;
ll C;
ll W[N], D[N], H[N];
bool revolution[N];
ll anything[N];

const int sign[2] = {1, -1};

struct info_t {
  set<ll> s;
  int t;
  ll d;

  ll L, R;

  info_t() {
    s.clear();
    t = d = 0;
    L = 0;
    R = -1;
  }

  void add_point(ll y) {
    y = (y - d) * sign[t];
    s.insert(y);
  }

  pair<ll, set<ll>::iterator> get_last_point() {
    if (s.empty()) {
      return {-1, s.end()};
    }
    if (t == 0) {
      auto it = prev(s.end());
      ll x = (*it) + d;
      return {x, it};
    } else {
      auto it = s.begin();
      ll x = -(*it) + d;
      return {x, it};
    }
  }

  pair<ll, set<ll>::iterator> get_first_point() {
    if (s.empty()) {
      return {-1, s.end()};
    }
    if (t == 0) {
      auto it = s.begin();
      ll x = (*it) + d;
      return {x, it};
    } else {
      auto it = prev(s.end());
      ll x = -(*it) + d;
      return {x, it};
    }
  }

  bool check(ll y) {
    ll x = (y - d) * sign[t];
    return L <= y && y <= R || s.count(x);
  }

  void set_segm(ll LL, ll RR) {
    s.clear();
    t = d = 0;
    L = LL;
    R = RR;
  }

  void apply(ll w) {
    t ^= 1;
    d = w - d;
    L = w - L;
    R = w - R;
    swap(L, R);
  }
} S;

int32_t main() {
#ifdef DEBUG
  freopen("in", "r", stdin);
#endif
  ios::sync_with_stdio(0);
  cin.tie(0);

  cin >> n >> C;
  for (int i = 3; i <= n; ++i) {
    cin >> W[i];
  }
  S.set_segm(0, C);
  anything[2] = 0;
  for (int i = 3; i <= n; ++i) {
    ll w = W[i];
    if (S.check(w)) {
      revolution[i] = true;
      S.set_segm(0, w);
    } else {
      chkmin(S.R, w);
      for (auto p = S.get_last_point(); p.fi > w; p = S.get_last_point()) {
        S.s.erase(p.se);
      }
      if (S.s.empty() && S.L > S.R) {
        cout << "No\n";
        exit(0);
      }
      S.apply(w);
      S.add_point(w);
    }
    anything[i] = S.get_first_point().fi;
    if (anything[i] == -1) {
      anything[i] = S.L;
      assert(S.L <= S.R);
    }
    /*debug(i);
    debug(anything[i]);
    for (ll x = 0; x <= W[i]; ++x) {
      cerr << (int)S.check(x);
    }
    cerr << endl;/**/
  }
  cout << "Yes\n";
  ll delta = W[n];
  D[n] = delta;
  int t = 0;
  for (int i = n; i >= 3; --i) {
    if (revolution[i]) {
      delta = W[i];
      t ^= 1;
    } else if (delta < W[i]) {
      delta = W[i] - delta;
    } else {
      assert(delta == W[i]);
      delta = anything[i - 1];
      t ^= 1;
    }
    D[i - 1] = sign[t] * delta;
  }
  H[1] = 0;
  for (int i = 2; i <= n; ++i) {
    H[i] = H[i - 1] + D[i];
  }
  ll mn = *min_element(H + 1, H + n + 1);
  if (mn < 0) {
    for (int i = 1; i <= n; ++i) {
      H[i] -= mn;
    }
  }
//  mdebug(D + 2, n - 1);
  for (int i = 1; i <= n; ++i) {
    cout << H[i] << ' ';
  }
  cout << endl;
  for (int i = 3; i <= n; ++i) {
    ll mx = max(H[i - 2], max(H[i - 1], H[i]));
    ll mn = min(H[i - 2], min(H[i - 1], H[i]));
    assert(W[i] == mx - mn);
  }

  return 0;
}
/*
10 10
3 5 6 5 5 6 5 8 
*/