// // 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; } sort(all(p), greater>()); vi tmp; int kk = 5e7 / 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; } 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; }