#include #include using namespace std; using namespace atcoder; using ll=long long; using ld=long double; ld pie=3.14159265359; ll inf=10000000000000001; ll mod=1000000007; int main(){ ll n; cin >> n; vectora(n); for (ll i = 0; i < n; i++) { cin >> a[i]; } bool ok=false; ll x=min(n,(ll)23); vector>>memo(4000000); vectortwo(25,1); for (ll i = 1; i < two.size(); i++) { two[i]=two[i-1]*2; } ll ans=-1; for (ll i = 1; i < two[x]; i++) { ll y=0; vectorb; for (ll j = 0; j < x; j++) { if (two[j]&i) { y+=a[j]; b.push_back(j); } } if (memo[y].size()>=1) { ok=true; ans=y; memo[y].push_back(b); break; }else{ memo[y].push_back(b); } } if (ans==-1) { cout << "No" << endl; return 0; } mapb,c; for (ll i = 0; i < memo[ans][0].size(); i++) { b[memo[ans][0][i]]+=1; } for (ll i = 0; i < memo[ans][1].size(); i++) { c[memo[ans][1][i]]+=1; } cout << "Yes" << endl; for (ll i = 0; i < n; i++) { if (b[i]>=1) { cout << a[i] << ' '; }else if (c[i]>=1) { cout << -a[i] << ' '; }else{ cout << 0 << ' '; } } }