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