#include <bits/stdc++.h>
using namespace std;
int n, cnt, t;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> t, cnt += 1 - t;
  if (n == 1)
    cout << (cnt == 1 ? "NO" : "YES");
  else
    cout << (cnt == 1 ? "YES" : "NO");
}
