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