#include <bits/stdc++.h>
using namespace std;
long long a[150000], b[150000];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    long long id = 0;
    long long mi = 9999999999;
    for (int i = 0; i < n; i++) {
      scanf("%lld", &b[i]);
      if (b[i] > b[id]) id = i;
      mi = min(b[i], mi);
    }
    if (mi == b[id]) {
      if (mi == 0) {
        printf("YES\n");
        for (int i = 0; i < n - 1; i++) printf("1 ");
        printf("1\n");
      } else
        printf("NO\n");
    } else {
      printf("YES\n");
      while (b[id] == b[(id - 1 + n) % n]) {
        id--;
        id = (id + n) % n;
      }
      a[id] = b[id];
      for (int i = id - 1; i >= 0; i--) {
        a[i] = b[i] + a[(i + 1 + n) % n];
        if (a[i] <= a[id]) a[i] += a[id];
      }
      for (int i = n - 1; i > id; i--) {
        a[i] = b[i] + a[(i + 1 + n) % n];
        if (a[i] <= a[id]) a[i] += a[id];
      }
      for (int i = 0; i < n - 1; i++) printf("%lld ", a[i]);
      printf("%lld\n", a[n - 1]);
    }
  }
  return 0;
}
