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