#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[22][600010][2]; bool dp[22][600010][2]; int main(void) { ll n; cin >> n; vector p(n); REP(i, n) cin >> p[i]; vector a(n); REP(i, n) a[i].first = p[i], a[i].second = i; sort(ALL(a)); bool ok = false; vector ans(n); const ll base = 300000; dp[0][base][0] = true; REP(i, min(n, 21LL)) REP(j, 600001) REP(k, 2) { if(!dp[i][j][k]) continue; if(j+a[i].first <= 600000) { dp[i+1][j+a[i].first][1] = true; pre[i+1][j+a[i].first][1] = PII(a[i].first, k); if(!ok && j+a[i].first == base) { ok = true; ll ni = i+1, nj = j+a[i].first, nk = 1; while(ni > 0) { dump(ni, nj, nk, pre[ni][nj][nk]); ans[a[ni-1].second] = pre[ni][nj][nk].first; 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].first >= 0) { dp[i+1][j-a[i].first][1] = true; pre[i+1][j-a[i].first][1] = PII(-a[i].first, k); if(!ok && j-a[i].first == base) { ok = true; ll ni = i+1, nj = j-a[i].first, nk = 1; while(ni > 0) { dump(ni, nj, nk, pre[ni][nj][nk]); ans[a[ni-1].second] = pre[ni][nj][nk].first; 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; }