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