require "big" a = read_line.split.map &.to_big_i puts a.reduce(1.to_big_i) { |acc, v| acc * v } % 3 == 0 ? "Yes" : "No"