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