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