#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, b[2] = {0, 0};
  cin >> n;
  while (n--) {
    int a;
    cin >> a;
    b[a]++;
  }
  if (b[1] == 1 && !b[0] || b[1] && b[0] == 1) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
