#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  cin >> n;
  vector<long long> vl(n, 0);
  bool check = true;
  int start = -1;
  scanf("%d", &vl[0]);
  for (int i = 1; i < n; i++) {
    scanf("%d", &vl[i]);
    if (check && vl[i - 1] < vl[i]) {
      check = false;
      start = i;
    }
  }
  if (check && vl[n - 1] < vl[0]) {
    check = false;
    start = 0;
  }
  if (check && vl[0] == 0) {
    cout << "YES\n";
    for (int i = 0; i < n; i++) {
      printf("%d ", 1);
    }
    return 0;
  }
  if (check) {
    cout << "NO";
    return 0;
  }
  long long now = (start + n - 1) % n;
  long long mul = 190000 / vl[start] + ((190000 % vl[start] > 0) ? 1 : 0);
  vl[now] = vl[start] * mul + vl[now];
  while (now != start) {
    long long next = (now + n - 1) % n;
    if (next == start) {
      break;
    }
    vl[next] = vl[next] + vl[now];
    now = next;
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    printf("%lld ", vl[i]);
  }
  return 0;
}
