#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, tmp, count = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    if (!tmp) {
      ++count;
    }
  }
  if (n == 1) {
    cout << (count ? "NO" : "YES") << endl;
  } else {
    if (!count || count > 1) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
  return 0;
}
