Ringo Mart, a convenience store, sells apple juice. On the opening day, there were A cans of juice in stock in the morning. Snuke buys B cans of juice every day. The manager checks the stock every night, adding D new cans if the stock falls to C or less. Determine if Snuke can buy juice indefinitely. Each test case consists of T queries. Constraints: 1 ≤ T ≤ 300, 1 ≤ A, B, C, D ≤ 10^18 (all integers). Input format: T lines with A, B, C, D values. Output: T lines, "Yes" if Snuke can buy juice indefinitely, "No" otherwise.

# Buggy version:
def solve(P):
    A, B, C, D = P
    if C >= B-1:
        return True
    if A<B or D<B:
        return False
    g = gcd(B,D)
    return B + A%g - g <= C

from math import gcd

T = int(input())
for _ in range(T):
    P = map(int, input().split())
    print("Yes" if solve(P) else "No")

# Fixed version:
def solve(P):
    A, B, C, D = P
    if A<B or D<B:
        return False
    if C >= B-1:
        return True
    g = gcd(B,D)
    return B + A%g - g <= C

from math import gcd

T = int(input())
for _ in range(T):
    P = map(int, input().split())
    print("Yes" if solve(P) else "No")

# Buggy version:
from math import gcd

def solve(a,b,c,d):
  
    if a < b:
        return False
    if d < b:
        return False

    g = gcd(b,d)
    m = b - (b-a-1)%g - 1
    print(m)
    return m <= c

T = int(input())
for _ in range(T):
    print('Yes' if solve(*map(int,input().split())) else 'No')


# Fixed version:
from math import gcd

def solve(a,b,c,d):
  
    if a < b:
        return False
    if d < b:
        return False

    g = gcd(b,d)
    c += 1
    m = c + (a-c)%g
    return b <= m

T = int(input())
for _ in range(T):
    print('Yes' if solve(*map(int,input().split())) else 'No')

# Buggy version:
from math import gcd

t = int(input())
queries = [tuple(int(x) for x in input().split()) for _ in range(t)]
for a, b, c, d in queries:
    if a < b:
        print("No")
        continue
    if b > d:
        print("No")
        continue
    if b - c <= 1:
        print("Yes")
        continue

    g = gcd(b, d)
    if c < a + ((b - a) // g) * g:
        print("No")
    else:
        print("Yes")

# Fixed version:
from math import gcd

t = int(input())
queries = [tuple(int(x) for x in input().split()) for _ in range(t)]
for a, b, c, d in queries:
    if a < b:
        print("No")
        continue
    if b > d:
        print("No")
        continue
    if b - c <= 1:
        print("Yes")
        continue

    g = gcd(-b, d)
    if g == 1 or b - c > g:
        print("No")
    else:
        m = a - ((a - c) // g) * g
        if c < m < b:
            print("No")
        else:
            print("Yes")

# Buggy version:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


def gcd(a, b):
    while b:
        a, b = b, a%b
    return a

def sub(a,b,c,d):
    x1 = a - max(1, (a - (c+1))//b) * b
    if d<b:
        ans = "No"
    elif a<b:
        ans = "No"
    elif d%b==0:
        if x1>=b:
            ans = "Yes"
        else:
            ans = "No"
    else:
        k = gcd(d,b)
        x2 = x1 - (x1 - (c+1))//k * k
        if x2>=b:
            ans = "Yes"
        else:
            ans = "No"
    return ans

t = int(input())
ans = []
for i in range(t):
    a,b,c,d = map(int, input().split())
    ans.append(sub(a,b,c,d))
write("\n".join(ans))

# Fixed version:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


def gcd(a, b):
    while b:
        a, b = b, a%b
    return a

def sub(a,b,c,d):
    x1 = a - (a - (c+1))//b * b
    if d<b:
        ans = "No"
    elif a<b:
        ans = "No"
    elif d%b==0:
        if x1>=b:
            ans = "Yes"
        else:
            ans = "No"
    else:
        k = gcd(d,b)
        x2 = x1 - (x1 - (c+1))//k * k
        if x2>=b:
            ans = "Yes"
        else:
            ans = "No"
    return ans

t = int(input())
ans = []
for i in range(t):
    a,b,c,d = map(int, input().split())
    ans.append(sub(a,b,c,d))
write("\n".join(ans))

# Buggy version:
T = int(input())

def gcd(a, b):
  if a < b:
    a, b = b, a
  if b == 0:
    return 0
  while a % b:
    a, b = b, a % b
  return b

while T:
  T -= 1
  
  A, B, C, D = map(int, input().split())
  
  if B > A or B > D:
    print("No")
  else:
    p = A - (A - C + B - 1) // B * B
    r = D % B
    g = gcd(r, B - r)
    if p < 0:
      print("No")
    elif r == 0 or (C - p) // g * g + p - B + r >= 0:
      print("Yes")
    else:
      print("No")

# Fixed version:
T = int(input())

def gcd(a, b):
  if a < b:
    a, b = b, a
  if b == 0:
    return 0
  while a % b:
    a, b = b, a % b
  return b

while T:
  T -= 1
  
  A, B, C, D = map(int, input().split())
  
  if B > A or B > D:
    print("No")
  else:
    p = A - (A - C + B - 1) // B * B
    r = D % B
    g = gcd(r, B - r)
    if p < 0:
      print("No")
    elif r == 0 or (C - r - p + g) // g * g + p - B + r >= 0:
      print("Yes")
    else:
      print("No")

# Buggy version:
def gcd(a,b):
  if b==0:
    return a
  else:
    return gcd(b,a%b)

n=int(input())
for _ in range(n):
  a,b,c,d=map(int,input().split())
  if a%b>c or b>d:
    print('No')
  else:
    if b==d:
      print('Yes')
    elif a%b+d==a:
      print('Yes')
    else:
      if c+gcd(b,d)>=b:
        print('Yes')
      else:
        print('No')

# Fixed version:
def gcd(a,b):
  if b==0:
    return a
  else:
    return gcd(b,a%b)

n=int(input())
for _ in range(n):
  a,b,c,d=map(int,input().split())
  if a<b or a%b>c or b>d:
    print('No')
  else:
    if b==d:
      print('Yes')
    elif a%b+d==a:
      print('Yes')
    else:
      if c+gcd(b,d)>=b:
        print('Yes')
      else:
        print('No')

# Buggy version:
t=int(input())
def gcd(x,y):
  if y==0:
    return x
  else:
    return gcd(y,x%y)
for i in range(t):
  a,b,c,d=map(int,input().split())
  if a<b:
    print("No")
  elif b>d:
    print("No")
  elif c>b:
    print("Yes")
  else:
    if b-gcd(b,d)+a%gcd(b,y)>c:
      print("No")
    else:
      print("Yes")

# Fixed version:
t=int(input())
def gcd(x,y):
  if y==0:
    return x
  else:
    return gcd(y,x%y)
for i in range(t):
  a,b,c,d=map(int,input().split())
  if a<b:
    print("No")
  elif b>d:
    print("No")
  elif c>b:
    print("Yes")
  else:
    if b-gcd(b,d)+a%gcd(b,d)>c:
      print("No")
    else:
      print("Yes")

# Buggy version:
t = int(input())
query = [tuple(map(int, input().split())) for _ in range(t)]
def gcd(x, y):
    if y == 0: return x
    return gcd(y, x % y)
for a, b, c, d in query:
    g = gcd(b, d)
    r = a % g
    if b <= ((c - r)//g + 1) * g: print('Yes')
    else: print('No')

# Fixed version:
t = int(input())
query = [tuple(map(int, input().split())) for _ in range(t)]
def gcd(x, y):
    if y == 0: return x
    return gcd(y, x % y)
for a, b, c, d in query:
    g = gcd(b, d)
    r = a % g
    m = ((c - r)//g + 1) * g
    if b <= m and b <= a and b <= d: print('Yes')
    else: print('No')

# Buggy version:
T = int(input())

def gcd (a: int,b: int) -> int:
    if a < b: a,b = b,a
    return a if b == 0 else gcd(b,a%b)
def lcm (a: int,b: int) -> int:
    return a // gcd(a,b) * b


for i in range(T):
    A,B,C,D = map(int,input().split(" "))
    g = gcd(B,D)
    if C >= ((B - g) + (A % g)):
        print("Yes")
    else:
        print("No")




# Fixed version:
T = int(input())

def gcd (a: int,b: int) -> int:
    if a < b: a,b = b,a
    return a if b == 0 else gcd(b,a%b)
def lcm (a: int,b: int) -> int:
    return a // gcd(a,b) * b


for i in range(T):
    A,B,C,D = map(int,input().split(" "))
    g = gcd(B,D)
    if A < B or D < B:
        print("No")
        continue
    if C >= ((B - g) + (A % g)):
        print("Yes")
    else:
        print("No")

# Buggy version:
n = int(input())
list = [map(int, input().split()) for i in range(n)]

def check(num):
    a, b, c, d = list[num]
    if b > d:
        return False
    if a < b:
        return False
    if a % b > c:
        return False
    if c < b and d != b:
        if (b - ( a % b )) // (d - b) != (c - ( a % b ) + 1) // (d - b):
            return False
    return True

for i in range(n):
    if check(i):
        print('Yes')
    else:
        print('No')

# Fixed version:
def gcd( a, b):
    if b == 0:
        return a
    else:
        return gcd( b, a % b)

n = int(input())
list = [map(int, input().split()) for i in range(n)]
 
def check(num):
    a, b, c, d = list[num]
    if a < b:
        return False
    if a % b > c:
        return False
    if b > d:
        return False
    if c < b and d != b:
        if (b - ( a % b ) - 1) // gcd( b, d) != ((c - ( a % b ))) // gcd( b, d):
            return False
    return True
 
for i in range(n):
    if check(i):
        print('Yes')
    else:
        print('No')

# Buggy version:
def findGCD(a,b):
    if a%b == 0:
        return b
    else:
        return findGCD(b,a%b)


def judge(a,b,c,d):
    if a<b or d<b:
        return False
    elif c >= b:
        return True
    else:
        g = findGCD(b,d)
        thr = b-g+a%g
        if thr > c:
            return False
        else:
            return True
        
T = int(input())
ABCD = []
for i in range(T):
    ABCD.append(list(map(int, input().split())))
        
for a,b,c,d in ABCD:
    if judge(a,b,c,d):
        print("YES")
    else:
        print("NO")

# Fixed version:

def findGCD(a,b):
    if a%b == 0:
        return b
    else:
        return findGCD(b,a%b)


def judge(a,b,c,d):
    if a<b or d<b:
        return False
    elif c >= b:
        return True
    else:
        g = findGCD(b,d)
        thr = b-g+a%g
        if thr > c:
            return False
        else:
            return True
        
T = int(input())
ABCD = []
for i in range(T):
    ABCD.append(list(map(int, input().split())))
        
for a,b,c,d in ABCD:
    if judge(a,b,c,d):
        print("Yes")
    else:
        print("No")

# Buggy version:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

T=int(input())
Juice=[None]*T
for i in range(T):
    Juice[i]=list(map(int,input().split()))

#A最初の在庫,Bすぬけ君が買う本数,C以下の場合D追加


#A→A%B
def juicecheck(i):
    A=Juice[i][0]
    B=Juice[i][1]
    C=Juice[i][2]
    D=Juice[i][3]

    if A<B:
        print("No")
        return
    elif B>D:
        print("No")
        return
    elif B-1<=C:
        print("Yes")
        return
    else:
        x=A%B
        y=D%B
        

        z=gcd(B,D)

        if z==1 or  (C+1)%z<=x%z<B%z or ( (C+1)%z>B%z and ((C+1)%z<=x%z or x%z<B%z) ):
            print("No")
            return

        print("Yes")
        return
                
        #(x+n*y)%B==[C+1,B)となるnがあれば"No"

for i in range(T):
    juicecheck(i)


# Fixed version:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

T=int(input())
Juice=[None]*T
for i in range(T):
    Juice[i]=list(map(int,input().split()))

#A最初の在庫,Bすぬけ君が買う本数,C以下の場合D追加


#A→A%B
def juicecheck(i):
    A=Juice[i][0]
    B=Juice[i][1]
    C=Juice[i][2]
    D=Juice[i][3]

    if A<B:
        print("No")
        return
    elif B>D:
        print("No")
        return
    elif B-1<=C:
        print("Yes")
        return
    else:
        x=A%B
        y=D%B
        

        z=gcd(B,D)

        if z==1 or B-(C+1)>=z or  (C+1)%z<=x%z<=(B-1)%z or ( (C+1)%z>B%z and ((C+1)%z<=x%z or x%z<B%z) ):
            print("No")
            return

        print("Yes")
        return
                
        #(x+n*y)%B==[C+1,B)となるnがあれば"No"

for i in range(T):
    juicecheck(i)

# Buggy version:
def gcd(x, y):
	while y:
		x, y = x, x % y
	return x

t = int(input())
a = []
d = 0
for i in range(t):
  a.append(list(map(int,input().split())))
for j in a:
  if j[0] < j[1] or j[1] > j[3]:
    print("No")
  else:
    b = j[0] % j[1]
    k = gcd(j[1],j[3])
    c = j[2] % k
    if b > c:
      d = j[2] + k + c - b
    else:
      d = j[2] + c - b
    if b > d:
      print("No")
    else:
      print("Yes")
    
    
    

# Fixed version:
def gcd(x, y):
	while y:
		x, y = y, x % y
	return x

t = int(input())
a = []
d = 0
for i in range(t):
  a.append(list(map(int,input().split())))
for j in a:
  if j[0] < j[1] or j[1] > j[3]:
    print("No")
  else:
    b = j[0] % j[1]
    k = gcd(j[1],j[3])
    c = j[0] % k
    d = j[2] % k
    if c > d:
      e = j[2] + c - d
    else:
      e = j[2] + k + c - d

    if j[1] > e:
      print("No")
    else:
      print("Yes")

# Buggy version:
def gcd(a, b):
    if a == 0: return b
    else : return gcd(b % a, a)

def solve():
    a, b, c, d = map(int, input().split())
    if c >= b:return "Yes"
    g = gcd(d, b)
    a %= b
    if((c-a+1) // g != (b-a-1) // g):return "Yes"
    else: return "No"


for _ in range(int(input())):
    print (solve())

# Fixed version:
def gcd(a, b):
    if a == 0: return b
    else : return gcd(b % a, a)

def solve():
    a, b, c, d = map(int, input().split())
    if d < b:return "No"
    if a < b:return "No"
    if c >= b:return "Yes"
    g = gcd(d, b)
    a %= b
    if((c-a) // g != (b-a-1) // g):return "No"
    else: return "Yes"


for _ in range(int(input())):
    print (solve())

# Buggy version:
from math import floor
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
T = int(input())
for i in range(T):
    A,B,C,D = map(int,input().split())
    if B > D:
        print("No")
    else:
        if A%B>C:
            print("No")
        else:
            d = gcd(B,D%B)
            r = A%B
            if r%d == 0:
                if B-D > C:
                    print("No")
                else:
                    print("Yes")
            else:
                if r+floor((B-r)/d) > C:
                    print("No")
                else:
                    print("Yes")

# Fixed version:
from math import floor
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
T = int(input())
for i in range(T):
    A,B,C,D = map(int,input().split())
    if B > D or B > A:
        print("No")
    else:
        if A%B>C:
            print("No")
        else:
            d = gcd(B,D%B)
            r = (A%B)%d
            if B - d + r > C:
                print("No")
            else:
                print("Yes")

# Buggy version:
def gcd(a, b):
    while b:
        a, b = b, a % b
        return a
T = int(input())
for _ in range(T):
    A,B,C,D = map(int,input().split())
    if A < B or D < B:
        print('No')
    else:
        g = gcd(B,D)
        k = B//g
        r = (A-C)%B
        if r == 0:
            sm = C
        else:
            sm = C+r-B
        if sm < 0:
            print('No')
        else:
            s = sm%g
            if s + (k-1)*g <= C:
                print('Yes')
            else:
                print('No')

# Fixed version:
def gcd(a, b):
    if a < b:
        a,b = b,a
    while b:
        a, b = b, a % b
    return a
T = int(input())
for _ in range(T):
    A,B,C,D = map(int,input().split())
    if A < B or D < B:
        print('No')
    else:
        g = gcd(B,D)
        k = B//g
        r = (A-C)%B
        if r == 0:
            sm = C
        else:
            sm = C+r-B
        if sm < 0:
            print('No')
        else:
            s = sm%g
            if s + (k-1)*g <= C:
                print('Yes')
            else:
                print('No')