#include <bits/stdc++.h>
#pragma comment(linker, "/stack:20000000")
using namespace std;
using mt = int32_t;
using fl = double;
template <typename T>
constexpr mt infValue = std::numeric_limits<T>::max() - 1000;
template <typename T>
constexpr mt maxValue =
    std::is_same<T, int>::value ? 1000000007 : 1000000000000000001ll;
constexpr mt INF = infValue<mt>;
constexpr int64_t MOD = 998244353ll;
constexpr double EPS = 1e-6;
constexpr mt MAX = maxValue<mt>;
using pr = pair<mt, mt>;
constexpr auto N = 20;
constexpr auto K = 256;
constexpr auto P = 19;
constexpr auto M = 200111;
mt n, a, s;
int main(void) {
  scanf("%d", &n);
  for (mt i = 0; i < (n); ++i) scanf("%d", &a), s += a;
  puts((n > 1 && n == s + 1) || (n == 1 && s == 1) ? "YES" : "NO");
  return 0;
}
