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