n=gets.to_i
a=gets.split.map &:to_i
h=Hash.new 0
a.map{|x|h[x]+=1}

if h.values.all?{|v|v*3==n||v*3==n*2}
h=h.map{|k,v|[k,v/(n/3)]}
a=h[0][0]
b=h[1]&&h[1][0]
c=h[2]&&h[2][0]
if c
puts a^b^c==0 ? "Yes":"No"
elsif b
puts a==0||b==0 ? "Yes":"No"
else
puts a==0 ? "Yes":"No"
end
else
puts "No"
end
