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