#include <bits/stdc++.h>
using namespace std;
const int MAXN = 140582 + 5;
int n, a[MAXN], mx = 0, v = 0;
long long b[MAXN];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  bool flg = 1;
  for (int i = 2; i <= n; i++) flg &= (a[i] == a[1]);
  if (flg && a[1] == 0) {
    puts("YES");
    for (int i = 1; i <= n; i++) printf("1 ");
    printf("\n");
    return 0;
  }
  if (flg) return puts("NO"), 0;
  for (int i = 1; i <= n; i++) (a[i] > mx) ? (mx = a[i], v = i) : 0;
  while (a[v] == mx) {
    v--;
    if (!v) v = n;
  }
  v++;
  if (v == n + 1) v = 1;
  long long x = 0;
  for (int i = 1; i <= n; i++) {
    if (i == 2) x += mx;
    x += a[v];
    b[v] = x;
    v--;
    if (!v) v = n;
  }
  puts("YES");
  for (int i = 1; i <= n; i++) printf("%lld ", b[i]);
  return 0;
}
