#include <bits/stdc++.h>
using namespace std;
int N;
int B[300005];
long long A[300005];
void Read() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) scanf("%d", &B[i]);
  for (int i = N + 1; i <= N * 2; i++) B[i] = B[i - N];
}
bool areEqual() {
  for (int i = 2; i <= N; i++)
    if (B[i] != B[i - 1]) return false;
  return true;
}
int findEndPoint() {
  for (int i = N + 1; i <= N * 2; i++)
    if (B[i] > B[i - 1]) return i;
}
void Solve() {
  if (areEqual()) {
    if (B[1] != 0) {
      printf("No\n");
    } else {
      printf("Yes\n");
      for (int i = 1; i <= N; i++) printf("1 ");
      printf("\n");
    }
    return;
  }
  printf("Yes\n");
  int endPoint = findEndPoint();
  A[endPoint] = B[endPoint];
  for (int i = endPoint - 1; endPoint - i + 1 <= N; i--) {
    A[i] = B[i];
    if (A[i] > B[i - 1]) continue;
    int diff = B[i - 1] - A[i];
    A[i] += (diff / A[i + 1]) * A[i + 1];
    if (A[i] <= B[i - 1]) A[i] += A[i + 1];
  }
  for (int i = 1; i <= N; i++) {
    if (A[i] == 0) A[i] = A[i + N];
    printf("%I64d ", A[i]);
  }
  printf("\n");
}
int main() {
  Read();
  Solve();
  return 0;
}
