@staticmethod
def a():
    n = sys.stdin.readline().rstrip()
    if ('3' in n):
        print('YES')
    elif ((int(n) % 3) == 0):
        print('YES')
    else:
        print('NO')
@staticmethod
def a():
    n = sys.stdin.readline().rstrip()
    if ('3' in n):
        print('YES')
    elif ((int(n) % 3) == 0):
        print('YES')
    else:
        print('NO')