#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <limits>
#include <climits>
#include <utility>
#include <algorithm>
#include <numeric>

using namespace std;

using ll = long long;
using ull = unsigned long long;

int main()
{
    int n;
    cin >> n;

    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }

    // all zero
    {
        bool all_zero = all_of(begin(a), end(a), [](const auto& ai){ return ai == 0; });
        if (all_zero) {
            cout << "Yes" << endl;
            return 0;
        }
    }

    sort(begin(a), end(a));

    if (n % 3 != 0) {
        cout << "No" << endl;
        return 0;
    }

    // x: 2N/3, 0: N/3
    {
        bool all_zero = all_of(begin(a), begin(a) + n/3, [](const auto& ai){ return ai == 0; });
        bool all_x = all_of(begin(a) + n/3, end(a), [&](const auto& ai){ return ai == a[n/3]; });
        if (all_zero && all_x) {
            cout << "Yes" <<endl;
            return 0;
        }
    }

    // x: N/3, y: N/3, z: N/3
    {
        bool all_x = all_of(begin(a), begin(a) + n/3, [&](const auto& ai){ return ai == a[0]; });
        bool all_y = all_of(begin(a) + n/3, begin(a) + 2*n/3, [&](const auto& ai){ return ai == a[n/3]; });
        bool all_z = all_of(begin(a) + 2*n/3, end(a), [&](const auto& ai){ return ai == a[2*n/3]; });
        if (all_x && all_y && all_z) {
            cout << "Yes" << endl;
            return 0;
        }
    }

    cout << "No" << endl;
    return 0;
}