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