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