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