#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, z = 0, o = 0;
  cin >> n;
  int p[n];
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    if (p[i] == 0) {
      z++;
    } else {
      o++;
    }
  }
  if (n == 1 && o == 1) {
    cout << "YES" << endl;
  } else if ((z == 1 && o > 1 && o == n - 1) || (n == 2 && z == 1 && o == 1)) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
