## Valid Walk or Not

Time Limit: 1 sec
Memory Limit: 512 MB
Attempts: 0
Accuracy: 0.00%
Author: Akashdeep Goel

Once Palai was lost in the mist of IITR. He was standing on a straight road and during each move, he can either stay there or move to twice or thrice the current distance.

Let the initial distance of Palai from the starting point be d. You are given another number n denoting the current distance of palai from the starting point.

Find if it is a valid place where he is standing or not.

**Input :**

t test cases (t<=10000)

each test case contains one line with 2 integers n,d

n<=1000000000000000

d<=1000000000

**Output : **

â€œYesâ€ or â€œNoâ€ (without quotes) depicting weather he is on a valid position or not.

Eg :

**Input : **

2

36 2

7 1

**Output : **

Yes

No

ID

SUBMITTED AT

STATUS

LANGUAGE

TIME

MEMORY USED

USER

TIME

STATUS

LANGUAGE

TIME

MEMORY USED