import sys
def main():
    N = int(input().strip())
    T = [[int(y) for y in input().strip().split()] for x in range(0,N)]
    j=True
    for line in T:
      Z = line[0]
      judge = [Z]
      hikaku = [Z]
      n = 1
      while j:
        n += 1
        if Z < line[1]:
          print("No")
          break
        Z = Z - line[1]
        hikaku.append(Z)
        if len(hikaku) > 3:
          hikaku.pop(0)
          if judge == hikaku:
            print("Yes")
            break
        if n <3:
            judge.append(Z)
        if Z <= line[2]:
            Z += line[3]
        if n <3:
            judge.append(Z)
        hikaku.append(Z)
        if len(hikaku) > 3:
          hikaku.pop(0)
          if judge == hikaku:
            print("Yes")
            break


if __name__ == '__main__':
    main()
