#include <bits/stdc++.h>
using namespace std;
int a, b, c, d;
int main() {
  cin >> b;
  for (a = 0; a < b; a++) {
    cin >> c;
    d += c;
  }
  if (b > 1 && d + 1 == b || b == 1 && d == 1)
    cout << "YES";
  else
    cout << "NO";
}
