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