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