#include <bits/stdc++.h>
using namespace std;
const double mx = 2e6 + 5;
void solve() {
  int n, x;
  cin >> n;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x == 0) cnt++;
  }
  if (n == 1 && cnt == 0) {
    cout << "YES\n";
    return;
  }
  if (n > 1 && cnt == 1) {
    cout << "YES\n";
    return;
  }
  cout << "NO\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
