#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  int nClosed = 0;
  int x;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x == 1) nClosed++;
  }
  if (n == 1)
    cout << ((nClosed == 1) ? "YES\n" : "NO\n");
  else
    cout << ((nClosed == n - 1) ? "YES\n" : "NO\n");
}
