open System

[<AutoOpen>]
module Cin =
    let read f = stdin.ReadLine() |> f
    let reada f = stdin.ReadLine().Split() |> Array.map f

let check A =
    Array.forall (fun x -> x = 0) A

let check2 N A =
    if N % 3 <> 0 then false
    else
        let zeros, rems = Array.splitAt (N/3) A
        let elm = Array.head rems
        Array.forall (fun e -> e = 0) zeros && Array.forall (fun e -> e = elm) rems

let check3 N (A: int array) =
    if N % 3 <> 0 then false
    else
        let jug = Array.chunkBySize 3 A
        let a,b,c = A.[N-2], A.[N-1], A.[0]
        Array.forall (fun (arr: int array) -> arr.[0] ^^^ arr.[1] ^^^ arr.[2] = 0) jug && a ^^^ b ^^^ c = 0

[<EntryPoint>]
let main _ =
    let N = read int
    let A = reada int |> Array.sort

    if check A then printfn "Yes"
    else if check2 N A then printfn "Yes"
    else if check3 N A then printfn "Yes"
    else printfn "No"
    0
