local n=io.read("n")
local a={}
for i=1,n do
    local hat=io.read("n")
    a[hat]=(a[hat] or 0)+1
end

if a[0]==n then
    print("Yes")
elseif n%3==0 then
    local b={}
    local thirds=true
    for hat,number in pairs(a) do
        if number~=n//3 then
            thirds=false
        end
        table.insert(b,hat)
    end
    if a[0]==n//3 and #b==2 then
        print("Yes")
    elseif #b==3 then
        if thirds and b[1]~b[2]~b[3]==0 then
            print("Yes")
        else
            print("No")
        end
    else
        print("No")
    end
else
    print("No")
end