def f(hs,l,r,xs) l.upto(r){|i| e=xs[i] as=hs.keys.to_a hs2={} as.each{|es| hs2[[es[0]+e,es[1],es[2]]]=0 hs2[[es[0],es[1]+e,es[2]]]=0 hs2[[es[0],es[1],es[2]+e]]=0 } hs=hs2.dup } return hs end n=gets.to_i xs=gets.split(" ").map{|e| e.to_i} s1=xs.sum if s1%3!=0 then puts "No" else s1=s1/3 hsl={} hsr={} m=n/2 hsl[[0,0,0]]=0 hsr[[0,0,0]]=0 as=f(hsl,0,m,xs) bs=f(hsr,m+1,n-1,xs) ans="No" as.each{|es1,v| ans="Yes" if bs.member?(es1.map{|e| s1-e}) } puts ans end