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