output_description: Print T lines. The i-th line should contain `Yes` if Snuke can buy apple juice
  indefinitely in the i-th query; `No` otherwise.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      T
      A_1 B_1 C_1 D_1
      A_2 B_2 C_2 D_2
      :
      A_T B_T C_T D_T
      
  
  In the i-th query, A = A_i, B = B_i, C = C_i, D = D_i.
attempt: import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
  
  sys.setrecursionlimit(10**7)
  inf = 10**20
  eps = 1.0 / 10**10
  mod = 10**9 + 7
  dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
  ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
  
  
  def LI():
      return [int(x) for x in sys.stdin.readline().split()]
  
  
  def LI_():
      return [int(x) - 1 for x in sys.stdin.readline().split()]
  
  
  def LF():
      return [float(x) for x in sys.stdin.readline().split()]
  
  
  def LS():
      return sys.stdin.readline().split()
  
  
  def I():
      return int(sys.stdin.readline())
  
  
  def F():
      return float(sys.stdin.readline())
  
  
  def S():
      return input()
  
  
  def pf(s):
      return print(s, flush=True)
  
  
  def main():
      t = I()
      aa = [LI() for _ in range(t)]
      rr = []
      for a, b, c, d in aa:
          if a < b or d < b:
              rr.append("No")
              continue
          if c >= b:
              rr.append("Yes")
              continue
          g = fractions.gcd(b, d)
          if g == 1:
              if b - c > 1:
                  rr.append("No")
              else:
                  rr.append("Yes")
              continue
          t = (a + d - c) % g
          if t == 0:
              t = g
          if b - c - t > 0:
              rr.append("No")
          else:
              rr.append("Yes")
  
      return "\n".join(rr)
  
  
  print(main())
  
problem_description: Statement
  
  Ringo Mart, a convenience store, sells apple juice.
  
  On the opening day of Ringo Mart, there were A cans of juice in stock in the
  morning. Snuke buys B cans of juice here every day in the daytime. Then, the
  manager checks the number of cans of juice remaining in stock every night. If
  there are C or less cans, D new cans will be added to the stock by the next
  morning.
  
  Determine if Snuke can buy juice indefinitely, that is, there is always B or
  more cans of juice in stock when he attempts to buy them. Nobody besides Snuke
  buy juice at this store.
  
  Note that each test case in this problem consists of T queries.
samples: [{"input": "14\n    9 7 5 9\n    9 7 6 9\n    14 10 7 12\n    14 10 8 12\n    14 10 9 12\n    14 10 7 11\n    14 10 8 11\n    14 10 9 11\n    9 10 5 10\n    10 10 5 10\n    11 10 5 10\n    16 10 5 10\n    1000000000000000000 17 14 999999999999999985\n    1000000000000000000 17 15 999999999999999985", "output": "No\n    Yes\n    No\n    Yes\n    Yes\n    No\n    No\n    Yes\n    No\n    Yes\n    Yes\n    No\n    No\n    Yes\n    \n\nIn the first query, the number of cans of juice in stock changes as follows:\n(D represents daytime and N represents night.)\n\n9 \u2192D 2 \u2192N 11 \u2192D 4 \u2192N 13 \u2192D 6 \u2192N 6 \u2192D x\n\nIn the second query, the number of cans of juice in stock changes as follows:\n\n9 \u2192D 2 \u2192N 11 \u2192D 4 \u2192N 13 \u2192D 6 \u2192N 15 \u2192D 8 \u2192N 8 \u2192D 1 \u2192N 10 \u2192D 3 \u2192N 12 \u2192D 5 \u2192N 14\n\u2192D 7 \u2192N 7 \u2192D 0 \u2192N 9 \u2192D 2 \u2192N 11 \u2192D \u2026\n\nand so on, thus Snuke can buy juice indefinitely.\n\n* * *"}, {"input": "24\n    1 2 3 4\n    1 2 4 3\n    1 3 2 4\n    1 3 4 2\n    1 4 2 3\n    1 4 3 2\n    2 1 3 4\n    2 1 4 3\n    2 3 1 4\n    2 3 4 1\n    2 4 1 3\n    2 4 3 1\n    3 1 2 4\n    3 1 4 2\n    3 2 1 4\n    3 2 4 1\n    3 4 1 2\n    3 4 2 1\n    4 1 2 3\n    4 1 3 2\n    4 2 1 3\n    4 2 3 1\n    4 3 1 2\n    4 3 2 1", "output": "No\n    No\n    No\n    No\n    No\n    No\n    Yes\n    Yes\n    No\n    No\n    No\n    No\n    Yes\n    Yes\n    Yes\n    No\n    No\n    No\n    Yes\n    Yes\n    Yes\n    No\n    No\n    No"}]