print( "Yes" if int(input())%6 ==0 else "No")