https://cses.fi/paste/06e3ebbca31b153ed42f95/for _ in range(int(input())):
a, b = map(int, input().split())
a, b = min(a, b), max(a, b)
is_possible = b <= (2 * a)
# or
# is_possible = b <= (2 * a) or a <= (2 * b)
# complex
# is_empty = (a, b) in ((0, 0), (1, 2), (2, 1))
# simple
is_empty = ((a + b) % 3) == 0
print("YES" if is_empty and is_possible else "NO")
