#include using namespace std; using ll = long long; using PII = pair; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() template void chmin(T &a, const T &b) { a = min(a, b); } template void chmax(T &a, const T &b) { a = max(a, b); } struct FastIO {FastIO() { cin.tie(0); ios::sync_with_stdio(0); }}fastiofastio; #ifdef DEBUG_ #include "../program_contest_library/memo/dump.hpp" #else #define dump(...) #endif const ll INF = 1LL<<60; PII pre[21][300001][2]; bool dp[21][300001][2]; int main(void) { ll n; cin >> n; vector a(n); REP(i, n) cin >> a[i]; bool ok = false; vector ans(n); dp[0][150000][0] = true; REP(i, min(n, 20LL)) REP(j, 300001) REP(k, 2) { if(!dp[i][j][k]) continue; // dump(i); if(j+a[i] <= 300000) { // dump(j+a[i], 1); dp[i+1][j+a[i]][1] = true; pre[i+1][j+a[i]][1] = PII(a[i], k); if(!ok && j+a[i] == 150000) { ok = true; ll ni = i+1, nj = j+a[i], nk = 1; while(ni > 0) { dump(ni, nj, nk, pre[ni][nj][nk]); ans[ni-1] = pre[ni][nj][nk].first; // if(pre[ni][nj][nk].first > 0) { // ans[ni-1] = a[ni-1]; // } else if(pre[ni][nj][nk].first < 0) { // ans[ni-1] = -a[ni-1]; // } else { // ans[ni-1] = 0; // } ll nni = ni-1; ll nnj = nj - pre[ni][nj][nk].first; ll nnk = pre[ni][nj][nk].second; ni = nni, nj = nnj, nk = nnk; } } } if(j-a[i] >= 0) { // dump(j-a[i], 1); dp[i+1][j-a[i]][1] = true; pre[i+1][j-a[i]][1] = PII(-a[i], k); if(!ok && j-a[i] == 150000) { ok = true; ll ni = i+1, nj = j-a[i], nk = 1; while(ni > 0) { dump(ni, nj, nk, pre[ni][nj][nk]); ans[ni-1] = pre[ni][nj][nk].first; // if(pre[ni][nj][nk].first > 0) { // ans[ni-1] = a[ni-1]; // } else if(pre[ni][nj][nk].first < 0) { // ans[ni-1] = -a[ni-1]; // } else { // ans[ni-1] = 0; // } ll nni = ni-1; ll nnj = nj - pre[ni][nj][nk].first; ll nnk = pre[ni][nj][nk].second; ni = nni, nj = nnj, nk = nnk; } } } // dump(j, k); dp[i+1][j][k] = true; pre[i+1][j][k] = PII(0, k); } if(ok) { cout << "Yes\n"; REP(i, n) cout << ans[i] << (i==n-1 ? '\n' : ' '); } else { cout << "No\n"; } return 0; }