#include using namespace std; #define ll long long int main() { int N; cin >> N; vector A(N); for (int i = 0; i < N; i++) cin >> A[i]; vector use(5000000, false); vector, int>> make; make.push_back({{}, 0}); for (int i = 0; i < N; i++) { vector, int>> nxt; for (auto p : make) { int sum = p.second, nsum; vector c = p.first, nc; nc = c; nc.push_back(0); nxt.push_back({nc, sum}); if (sum+A[i] == 0) { cout << "Yes\n"; for (int j = 0; j < N; j++) { if (j < i) cout << c[j]*A[j]; else if (j == i) cout << A[j]; else cout << 0; if (j < N-1) cout << " "; } cout << endl; return 0; } if (sum-A[i] == 0) { cout << "Yes\n"; for (int j = 0; j < N; j++) { if (j < i) cout << c[j]*A[j]; else if (j == i) cout << -A[j]; else cout << 0; if (j < N-1) cout << " "; } cout << endl; return 0; } if (!use[sum+A[i]+2500000]) { nsum = sum+A[i]; nc = c; nc.push_back(1); nxt.push_back({nc, nsum}); use[nsum+2500000] = true; } if (!use[sum-A[i]+2500000]) { nsum = sum-A[i]; nc = c; nc.push_back(-1); nxt.push_back({nc, nsum}); use[nsum+2500000] = true; } } make = nxt; } cout << "No\n"; return 0; }