#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  int n;
  int a[10000];
  int count = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == 0) count++;
    if (n == 1 && a[n] == 1) {
      count++;
    }
    if (n == 1 && a[n] == 0) {
      count--;
    }
  }
  if (count > 1 || count == 0) {
    cout << "NO";
  } else if (count == 1) {
    cout << "YES";
  }
  return 0;
}
