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.