#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int val[n];
  int fast = 0;
  for (int i = 0; i < n; i++) {
    cin >> val[i];
    fast += val[i];
  }
  if (n == 1 and fast) {
    cout << "YES";
  } else if (n >= 2 and fast == n - 1) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
