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