#include <bits/stdc++.h>
using namespace std;
const int N = 400002;
int n, b[N];
long long a[N];
int main() {
  scanf("%d", &n);
  bool zero = true;
  for (int(i) = (1); (i) <= (int)(n); (i)++)
    scanf("%d", &b[i]), b[i + n] = b[i], zero &= !b[i];
  if (zero) {
    printf("YES\n");
    for (int(i) = (1); (i) <= (int)(n); (i)++) printf("1 ");
    printf("\n");
    return 0;
  }
  for (int(i) = (2 * n); (i) >= (n + 1); --(i))
    if (b[i] > b[i - 1]) {
      a[i] = b[i];
      for (int(j) = (i - 1); (j) >= (1); --(j)) {
        if (a[j + 1] > b[j])
          a[j] = b[j];
        else {
          a[j + 1] += ((b[j] - a[j + 1]) / a[j + 2] + 1) * a[j + 2];
          a[j] = b[j];
        }
      }
      a[1] = a[n + 1];
      printf("YES\n");
      for (int(i) = (1); (i) <= (int)(n); (i)++) printf("%lld ", a[i]);
      printf("\n");
      return 0;
    }
  printf("NO\n");
  return 0;
}
