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