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