#include <bits/stdc++.h>
using namespace std;
typedef priority_queue<int, vector<int>, greater<int>()> pqi;
typedef priority_queue<long, vector<long>, greater<long>()> pql;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, x, cnt = 0;
  cin >> n;
  for (int i = 0; i <= n - 1; i++) {
    cin >> x;
    if (x == 0) cnt++;
  }
  if (n == 1 && cnt == 1)
    cout << "NO";
  else if (n == 1 && cnt == 0)
    cout << "YES";
  else if (cnt > 1 || cnt == 0)
    cout << "NO";
  else
    cout << "YES";
  return (0);
}
