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