#include <bits/stdc++.h>
const long long int mod = 1000000007;
const long long int INF = 1000000000000000000;
using namespace std;
unsigned long long int prime(unsigned long long int n) {
  if (n <= 1) return 0;
  if (n <= 3) return 1;
  if (n % 2 == 0 || n % 3 == 0) return 0;
  for (unsigned long long int i = 5; i * i <= n; i += 6)
    if (n % (i) == 0 || n % (i + 2) == 0) return 0;
  return 1;
}
int main() {
  int n, a, co = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    if (a == 1) {
      co++;
    }
  }
  if ((co == n - 1 && n > 1) || (n == 1 && co == 1)) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
