#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, dem = 0;
  scanf("%d", &n);
  vector<int> a;
  for (int i = 0; i < n; i++) {
    int temp;
    scanf("%d", &temp);
    a.push_back(temp);
  }
  if ((n == 1) && (a.front() == 1))
    printf("YES");
  else if ((n == 1) && (a.front() != 1))
    printf("NO");
  else {
    for (int i = 0; i < n; i++)
      if (a[i] == 0) dem++;
    if (dem == 1)
      printf("YES");
    else
      printf("NO");
  }
}
