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