n = int(input())

for i in range(n):
  a,b,c,d = map(int,input().split())

  flg = False
  s = [a]
  t = a % b
  while (a >= b and d >= b):
    if(t > c):
      break
    else:
      t += d
      if(t in s):
        flg = True
        break
      else:
        s.append(t)
        t = t % b
  if(flg):
    print("Yes")
  else:
    print("No")

  #if( (a<b) or (d<b) or ( a > b and a%b > c) or ( d > b and ((a%b)+d)%b > c) or b > h or (a % d > c and b > c) or  (d %b > c and b > c) or (h % b > c and b > c)):
  del(s)