#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a;
  int count = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    if (a == 1) count += 1;
  }
  if (n != 1) {
    if (count == (n - 1))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  } else {
    if (count == 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
