#include <bits/stdc++.h>
using namespace std;
int n, num, dem = 0, var;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &num);
    if (num == 0) dem++;
  }
  if (n == 1 && num == 0)
    printf("NO\n");
  else if (dem == 1 || (n == 1 && num == 1))
    printf("YES\n");
  else
    printf("NO\n");
}
