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