x = gets.split.map(&:to_i) ans = false 3.times do |i| ans = true if x[i]%3 == 0 end puts (ans ? "Yes" : "No")