n = gets.to_i
a = gets.split.map(&:to_i)
if a.uniq.size == 1
  puts a[0].zero? ? 'Yes' : 'No'
elsif a.uniq.size == 2
  puts a.count(0) * 3 == n ? 'Yes' : 'No'
elsif a.uniq.size == 3
  b = Array.new(30, 0)
  a.each do |x|
    30.times do |i|
      b[i] += x[i]
    end
  end
  puts b.select{_1.odd?}.any? ? "No" : "Yes"
else
  puts 'No'
end