#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  if (n == 1) {
    int x;
    scanf("%d", &x);
    puts(x == 1 ? "YES" : "NO");
  } else {
    int cnt = 0;
    for (int i = 0; i < n; ++i) {
      int x;
      scanf("%d", &x);
      cnt += x;
    }
    puts(cnt + 1 == n ? "YES" : "NO");
  }
  return 0;
}
