#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
int b[N];
long long a[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  int n;
  cin >> n;
  int mx = 0;
  for (int i = 0; i < n; ++i) cin >> b[i], mx = max(mx, b[i]);
  for (int i = 0; i < n; ++i)
    if (b[i] == mx && b[(n + i - 1) % n] < mx) {
      if (!b[(n + i - 1) % n]) b[(n + i - 1) % n] = mx;
      cout << "Yes" << '\n';
      a[i] = b[i];
      int j = (n + i - 1) % n;
      while (j != i) {
        a[j] = a[(j + 1) % n] + b[j];
        j = (n + j - 1) % n;
      }
      for (int j = 0; j < n; ++j) cout << a[j] << ' ';
      return 0;
    }
  if (mx == 0) {
    cout << "Yes" << '\n';
    for (int i = 0; i < n; ++i) cout << 1 << ' ';
    return 0;
  }
  cout << "No";
  return 0;
}
