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