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
  import fractions
  
  # import sys
  # input = sys.stdin.readline
  
  
  def make_divisors(n):
      divisors = []
      for i in range(1, int(n**0.5) + 1):
          if n % i == 0:
              divisors.append(i)
              if i != n // i:
                  divisors.append(n // i)
  
      # divisors.sort()
      return divisors
  
  
  def ValueToBits(x, digit):
      res = [0 for i in range(digit)]
      now = x
      for i in range(digit):
          res[i] = now % 2
          now = now >> 1
      return res
  
  
  def BitsToValue(arr):
      n = len(arr)
      ans = 0
      for i in range(n):
          ans += arr[i] * 2**i
      return ans
  
  
  def ZipArray(a):
      aa = [[a[i], i] for i in range(n)]
  
      aa.sort(key=lambda x: x[0])
      for i in range(n):
          aa[i][0] = i + 1
      aa.sort(key=lambda x: x[1])
      b = [aa[i][0] for i in range(len(a))]
      return b
  
  
  def ValueToArray10(x, digit):
      ans = [0 for i in range(digit)]
      now = x
      for i in range(digit):
          ans[digit - i - 1] = now % 10
          now = now // 10
      return ans
  
  
  def Zeros(a, b):
      if b <= -1:
          return [0 for i in range(a)]
      else:
          return [[0 for i in range(b)] for i in range(a)]
  
  
  class Bit:
      def __init__(self, n):
          self.size = n
          self.tree = [0] * (n + 1)
  
      def sum(self, i):
          s = 0
          while i > 0:
              s += self.tree[i]
              i -= i & -i
          return s
  
      def add(self, i, x):
          while i <= self.size:
              self.tree[i] += x
              i += i & -i
  
  
  """
  def cmb(n, r, p):
      if (r < 0) or (n < r):
          return 0
      r = min(r, n - r)
      return fact[n] * factinv[r] * factinv[n-r] % p
  
  p = 2
  N = 10 ** 6 + 2
  fact = [1, 1]  # fact[n] = (n! mod p)
  factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
  inv = [0, 1]  # factinv 計算用
  
  for i in range(2, N + 1):
      fact.append((fact[-1] * i) % p)
      inv.append((-inv[p % i] * (p // i)) % p)
      factinv.append((factinv[-1] * inv[-1]) % p)
  
  """
  
  # a = list(map(int, input().split()))
  
  #################################################
  #################################################
  #################################################
  #################################################
  
  
  # 9:04
  
  n = int(input())
  
  for i in range(n):
      a, b, c, d = list(map(int, input().split()))
      if b > d or a < b:
          print("No")
          continue
      G = fractions.gcd(b, d)
      minim = a % G
      if b - G <= c and minim <= c:
          print("Yes")
      else:
          print("No")
  
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"}]