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