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