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