#include <bits/stdc++.h>
using namespace std;
long long i, j, n, a, c;
int main() {
  cin >> n;
  j = n;
  while (j--) {
    cin >> a;
    if (a == 0) {
      c++;
    }
  }
  if (n == 1 && c == 0) {
    puts("YES");
  } else if (n != 1 && c == 1) {
    puts("YES");
  } else {
    puts("NO");
  }
}
