function main(input) {
    const args = input.split('\n');
    const N = parseInt(args[0], 10);
    const A = args[1].split(' ').map((n) => parseInt(n, 10));
    var count = {};
    for (var i = 0; i < N; i++) {
        x = A[i]
        if (x in count) {
            count[x] += 1;
        }
        else {
            count[x] = 1;
        }
    }
    l = Object.keys(count).length;
    if (l == 1) {
        a = parseInt(Object.keys(count)[0], 10)
        if (a == 0) {
            console.log('Yes');
            return;
        }
    } else if (l == 2) {
        a = parseInt(Object.keys(count)[0], 10);
        b = parseInt(Object.keys(count)[1], 10);
        if (a * b == 0) {
            if (b == 0) {
                b, a = a, b;
            }
            if (count[a] == 2 && count[b] == 1) {
                console.log('Yes');
                return;
            }
        }
    } else if (l == 3) {
        a = parseInt(Object.keys(count)[0], 10);
        b = parseInt(Object.keys(count)[1], 10);
        c = parseInt(Object.keys(count)[2], 10);
        if (count[a] == count[b] && count[b] == count[c]) {
            console.log('Yes');
            return;
        }
    }
    console.log('No');
    return;
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
