#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long mod = 1e9 + 7;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n, k = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (x == 0) k++;
  }
  if (n == 1 && k == 1)
    cout << "NO" << endl;
  else if (n == 1 && k == 0)
    cout << "YES" << endl;
  else if (k == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
