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