#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int N;
int b[200000];
long long a[200000];
long long BIG = 1e10;
int main() {
  cin >> N;
  bool notZero = false;
  for (int i = 0; i < N; i++) {
    cin >> b[i];
    if (b[i] != 0) notZero = true;
  }
  if (!notZero) {
    cout << "YES" << endl;
    for (int i = 0; i < N; i++) cout << 1 << ' ';
    cout << endl;
    return 0;
  }
  int ind = -1;
  for (int i = 0; i < N; i++)
    if (b[i] > b[(i - 1 + N) % N]) ind = i;
  if (ind == -1) {
    cout << "NO" << endl;
    return 0;
  }
  a[ind] = b[ind];
  int full = (ind - 1 + N) % N;
  a[full] = b[full] + BIG * a[ind];
  for (int i = ind - 1; i >= 0; i--) {
    if (i == full) continue;
    a[i] = b[i] + a[i + 1];
  }
  for (int i = N - 1; i > ind; i--) {
    if (i == full) continue;
    a[i] = b[i] + a[(i + 1) % N];
  }
  cout << "YES" << endl;
  for (int i = 0; i < N; i++) cout << a[i] << ' ';
  cout << endl;
  return 0;
}
