#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f3f3f3f3f;
long long power(long long a, long long b) {
  long long res = 1;
  while (b != 0) {
    if (b & 1) {
      res = (res * a) % 1000000007;
    }
    a = (a * a) % 1000000007;
    b = (b / 2);
  }
  return res % 1000000007;
}
long long fac[100001];
void factorial(long long n) {
  fac[0] = 1;
  for (long long i = 1; i <= n; i++) {
    fac[i] = (fac[i - 1] * i) % 1000000007;
    fac[i] %= 1000000007;
  }
}
long long ncr(long long n, long long r) {
  if (n < 0) return (long long)0;
  long long nn = fac[n];
  nn /= fac[r];
  nn /= fac[n - r];
  return nn;
}
int32_t main() {
  long long i, j, k, l, n, m, t;
  t = 1;
  while (t--) {
    cin >> n;
    map<long long, long long> p;
    if (n == 1) {
      cin >> k;
      if (k == 1) {
        cout << "YES\n";
      } else
        cout << "NO\n";
      continue;
    }
    for (i = 0; i < n; i++) {
      cin >> k;
      p[k]++;
    }
    if (p.size() == 1) {
      cout << "NO\n";
    } else if (p[0] == 1) {
      cout << "YES\n";
    } else
      cout << "NO\n";
  }
  return 0;
}
