#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  vector<int> b(n);
  for (int i = 0; i < n; i++) cin >> b[i];
  vector<long long> a(n);
  int mx = *max_element(b.begin(), b.end());
  int st = -1;
  for (int i = 0; i < n; i++) {
    if (b[(i + 1) % n] > b[i]) {
      st = (i + 1) % n;
    }
  }
  if (st == -1) {
    if (b[0] == 0) {
      cout << "YES\n";
      for (int i = 0; i < n; i++) cout << 1 << " ";
      return 0;
    }
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  a[st] = b[st];
  a[(st + n - 1) % n] = a[st] * (mx / a[st] + 5) + b[(st + n - 1) % n];
  for (int i = (st + n - 2) % n; i != st; i = (i + n - 1) % n) {
    a[i] = a[(i + 1) % n] + b[i];
  }
  for (long long i : a) cout << i << " ";
  return 0;
}
