#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; vector A; map> memo1; map> memo2; int L; void dfs(int i, int end, int sum, bool ok, vector &nums) { if (i == end) { if (ok) { if (end < L) { memo1[sum] = nums; } else { memo2[sum] = nums; } } } else { for (int a = -1; a <= 1; ++a) { int v = A[i] * a; nums.push_back(v); if (a == 0) { dfs(i + 1, end, sum + v, ok, nums); } else { dfs(i + 1, end, sum + v, true, nums); } nums.pop_back(); } } } int main() { int N; cin >> N; if (N == 1) { cout << "No" << endl; return 0; } A.resize(N); for (int i = 0; i < N; ++i) { cin >> A[i]; } L = min(N, 22); int mid = L / 2; vector nums; dfs(0, mid, 0, false, nums); dfs(mid, L, 0, false, nums); int ans[N]; memset(ans, 0, sizeof(ans)); bool ok = false; for (auto &[sum, nums] : memo1) { if (sum == 0) { ok = true; for (int i = 0; i < nums.size(); ++i) { ans[i] = nums[i]; } } else { if (memo2.count(-sum)) { ok = true; vector temp = nums; temp.insert(temp.end(), memo2[-sum].begin(), memo2[-sum].end()); for (int i = 0; i < temp.size(); ++i) { ans[i] = temp[i]; } } } } if (memo2.count(0)) { ok = true; vector &nums = memo2[0]; for (int i = mid; i < N; ++i) { ans[i] = nums[i - mid]; } } if (ok) { cout << "Yes" << endl; for (int i = 0; i < N; ++i) { cout << ans[i]; if (i != N - 1) cout << " "; } cout << endl; } else { cout << "No" << endl; } return 0; }