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