#include <bits/stdc++.h>
using namespace std;
const int maxn = 140590;
const int maxnum = 187126;
long long data1[maxn];
long long ans[maxn];
long long sum[maxn];
int n;
int main() {
  scanf("%d", &n);
  long long ma = -1, mapl = -1;
  bool issame = true;
  for (int i = 0; i < n; i++) {
    scanf("%lld", &data1[i]);
  }
  for (int i = 0; i < n; i++) {
    if (data1[i] > ma && data1[i] > data1[(i - 1 + n) % n]) {
      ma = data1[i];
      mapl = i;
    }
  }
  for (int i = 0; i < n - 1; i++) {
    if (data1[i] != data1[i + 1]) issame = false;
  }
  if (issame) {
    if (data1[1] != 0) {
      puts("NO");
    } else {
      puts("YES");
      for (int i = 1; i <= n; i++) {
        printf("1 ");
      }
    }
    return 0;
  }
  puts("YES");
  ans[mapl] = data1[mapl];
  for (int i = mapl - 1; i >= 0; i--) {
    ans[i] = ans[i + 1] + data1[i];
  }
  for (int i = n - 1; i >= mapl + 1; i--) {
    ans[i] = ans[(i + 1 + n) % n] + data1[i];
  }
  long long base = ma * 10;
  for (int i = 0; i < n; i++) {
    if (i == mapl) continue;
    ans[i] += base;
  }
  for (int i = 0; i < n; i++) {
    printf("%lld ", ans[i]);
  }
}
