#include <bits/stdc++.h>
using namespace std;
long long int b[1000005], a[1000005];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int s = 0;
  for (int i = 0; i <= n - 1; i++) {
    cin >> b[i];
    if (b[i]) s++;
  }
  if (s == 0) {
    cout << "YES\n";
    for (int i = 0; i <= n - 1; i++) cout << "1 ";
    return 0;
  }
  for (int i = 0; i <= n - 1; i++) {
    if (b[i] > b[(i + n - 1) % n]) {
      a[i] = b[i];
      a[(i + n - 1) % n] = a[i] * 1e9 + b[(i + n - 1) % n];
      for (int j = (i + 2 * n - 2) % n; j != i; j = (j + n - 1) % n) {
        a[j] = a[(j + 1) % n] + b[j];
      }
      cout << "YES\n";
      for (int i = 0; i <= n - 1; i++) {
        cout << a[i];
        cout << " ";
      }
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
