#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, s, t;
  cin >> n;
  i = 0;
  t = 0;
  while (i < n) {
    i++;
    cin >> s;
    t = t + s;
  }
  if (n == 1 && t == 1)
    cout << "YES";
  else {
    if (n == 1 && t == 0)
      cout << "NO";
    else {
      if (t == n - 1)
        cout << "YES";
      else
        cout << "NO";
    }
  }
}
