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