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