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