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