#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool ok = 0;
  short num = 0;
  for (int i = 0; i < n; i++) {
    cin >> num;
    if (num) {
      continue;
    } else {
      if (ok) {
        cout << "NO";
        return 0;
      }
      ok = 1;
    }
  }
  if (ok && n != 1) {
    cout << "YES" << endl;
  } else {
    if (n == 1 && num == 1)
      cout << "YES";
    else
      cout << "NO";
  }
}
