#include <bits/stdc++.h>
long long a[1001];
using namespace std;
int main() {
  long long n, cnt = 0;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 0) {
      cnt++;
    }
    if (n == 1) {
      if (a[i] == 0) {
        cout << "NO";
        return 0;
      } else {
        cout << "YES";
        return 0;
      }
    }
  }
  if (cnt >= 0 && cnt != 1) {
    cout << "NO";
    return 0;
  } else {
    cout << "YES";
    return 0;
  }
}
