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