#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000");
using namespace std;
const int maxn = 500400;
long long val[maxn], ans[maxn];
long long n;
int main() {
  scanf("%I64d", &n);
  for (int i = 0; i < n; i++) scanf("%I64d", &val[i]);
  int clef = -1;
  for (int i = 0; i < n; i++) {
    int bef = (i - 1 + n) % n;
    if (val[i] > val[bef]) clef = i;
  }
  if (clef == -1) {
    if (val[0] == 0) {
      puts("YES");
      for (int i = 0; i < n; i++) printf("1 ");
    } else
      puts("NO");
    exit(0);
  }
  puts("YES");
  ans[clef] = val[clef];
  for (int ii = 1; ii < n; ii++) {
    int i = (clef - ii + n) % n;
    int bef = (i - 1 + n) % n;
    int nxt = (i + 1 + n) % n;
    ans[i] = val[i];
    long long hg = val[bef] - ans[i];
    if (hg < 0) continue;
    ans[i] += (hg + 10) / ans[nxt] * ans[nxt] + ans[nxt];
  }
  for (int i = 0; i < n; i++) printf("%I64d ", ans[i]);
  return 0;
}
