from fractions import gcd
n = int(input())
for i in range(n):
  a,b,c,d = map(int,input().split())
  if b>d or a<b:
    print("No")
  elif c>=b-1:
    print("Yes")
  elif d%b == 0:
    if a<=c:
      print("Yes")
    elif a%b<=c:
      print("Yes")
    else:
      print("No")
  elif gcd(a,b)%(b-c) == 0:
    if a%b<=c and d%(b-c) == 0:
      print("Yes")
    else:
      print("No")
  else:
    print("No")