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