#include <bits/stdc++.h>
int main() {
  int ara[1005], n, count = 0, i;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &ara[i]);
  }
  for (i = 0; i < n; i++) {
    if (ara[i] == 0) {
      count++;
    }
  }
  if (count == 1 && n != 1) {
    printf("YES");
  } else if (n == 1 && count == 0) {
    printf("YES");
  } else {
    printf("NO");
  }
  return 0;
}
