#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, i, input, n, arr[1000];
int main(void) {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (i = 0; i < n; i++) {
    if (arr[i] == 0) c++;
  }
  if (c == 1 and n > 1)
    printf("YES");
  else if (c == 0 and n == 1)
    printf("YES");
  else
    printf("NO");
}
