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