import sequtils, strutils

let
  xs = stdin.readLine.split.map parseInt
  bool = xs.anyIt it mod 3 == 0

echo ["No", "Yes"][ord bool]