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