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