#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
inline void chmin(T &t, U f) {
  if (t > f) t = f;
}
template <class T, class U>
inline void chmax(T &t, U f) {
  if (t < f) t = f;
}
signed main() {
  long long n;
  cin >> n;
  long long cnt = 0;
  for (long long i = 0; i < (n); i++) {
    long long a;
    cin >> a;
    cnt += a;
  }
  if (n == 1) {
    cout << (cnt == 1 ? "YES" : "NO") << endl;
  } else {
    cout << ((cnt + 1 == n) ? "YES" : "NO") << endl;
  }
  return 0;
}
