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