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