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