// // Created by yamunaku on 2020/04/03. // #include using namespace std; #define rep(i, n) for(int i = 0; i < (n); i++) #define repl(i, l, r) for(int i = (l); i < (r); i++) #define per(i, n) for(int i = ((n)-1); i >= 0; i--) #define perl(i, l, r) for(int i = ((r)-1); i >= (l); i--) #define all(x) (x).begin(),(x).end() #define MOD9 998244353 #define MOD1 1000000007 #define IINF 1000000000 #define LINF 1000000000000000000 #define SP <<" "<< #define CYES cout<<"Yes"<; using mti = vector>; using vl = vector; using mtl = vector>; using pi = pair; using pl = pair; template using heap = priority_queue, function>; unsigned long long xor128(){ static unsigned long long x = 123456789, y = 362436069, z = 521288629, w = 88675123; unsigned long long t = (x ^ (x << 11)); x = y; y = z; z = w; return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))); } int main(){ //CFS; int n; cin >> n; map mp; vi a(n); vector> p(n); rep(i, n){ cin >> a[i]; p[i] = {a[i], i}; auto itr = mp.find(a[i]); if(itr != mp.end()){ CYES; vi ans(n, 0); ans[i] = a[i], ans[itr->second] = -a[i]; rep(j, n){ cout << ans[j] << " "; } cout << endl; return 0; } mp[a[i]] = i; } vi tmp; int kk = 2e7 / n; rep(t, kk){ ll sum = 0; tmp = vi(n, 0); bool ok = false; rep(i, n){ tmp[i] = xor128() % 3 - 1; if(tmp[i] != 0) ok = true; sum += tmp[i] * p[i].first; } if(ok) if(sum == 0) goto next; } rep(t, kk){ rep(i, n / 2){ swap(p[xor128() % n], p[xor128() % n]); } ll sum = 0; tmp = vi(n, 0); repl(i, xor128() % n, n){ if(sum > 0){ if(sum - p[i].first == 0){ tmp[i] = -1; goto next; }else{ if(xor128() % 2){ tmp[i] = -1; sum -= p[i].first; } } }else{ if(sum + p[i].first == 0){ tmp[i] = 1; goto next; }else{ if(xor128() % 2){ tmp[i] = 1; sum += p[i].first; } } } } } CNO; return 0; next:; CYES; vi ans(n, 0); rep(i, n){ ans[p[i].second] = tmp[i] * p[i].first; } rep(i, n){ cout << ans[i] << " "; } cout << endl; return 0; }