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