#include <bits/stdc++.h>
using namespace std;
int n, a[201000];
long long b[201000];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%lld", &a[i]);
  long long mn = *min_element(a + 1, a + n + 1);
  long long mx = *max_element(a + 1, a + n + 1);
  if (mn == mx) {
    if (mn == 0) {
      puts("YES");
      for (int i = 1; i <= n; ++i) printf("1 ");
    } else {
      puts("NO");
      return 0;
    }
  }
  for (int i = 1; i <= n; ++i)
    if (a[i] == mx && a[i == 1 ? n : i - 1] != mx) {
      puts("YES");
      b[i] = a[i];
      for (int j = (i == 1 ? n : i - 1); j != i; j = (j == 1 ? n : j - 1)) {
        long long val = b[j == n ? 1 : j + 1];
        long long nxt = a[j == 1 ? n : j - 1];
        b[j] = ((nxt + 1 - a[j] + val - 1) / val) * val + a[j];
      }
      for (int j = 1; j <= n; ++j) printf("%lld ", b[j]);
      return 0;
    }
}
