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.

Constraints

* 1 \leq T \leq 300
* 1 \leq A, B, C, D \leq 10^{18}
* All values in input are integers.

Input

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.

Output

Print T lines. The i-th line should contain `Yes` if Snuke can buy apple juice indefinitely in the i-th query; `No` otherwise.

Examples

Input

14
9 7 5 9
9 7 6 9
14 10 7 12
14 10 8 12
14 10 9 12
14 10 7 11
14 10 8 11
14 10 9 11
9 10 5 10
10 10 5 10
11 10 5 10
16 10 5 10
1000000000000000000 17 14 999999999999999985
1000000000000000000 17 15 999999999999999985


Output

No
Yes
No
Yes
Yes
No
No
Yes
No
Yes
Yes
No
No
Yes


Input

24
1 2 3 4
1 2 4 3
1 3 2 4
1 3 4 2
1 4 2 3
1 4 3 2
2 1 3 4
2 1 4 3
2 3 1 4
2 3 4 1
2 4 1 3
2 4 3 1
3 1 2 4
3 1 4 2
3 2 1 4
3 2 4 1
3 4 1 2
3 4 2 1
4 1 2 3
4 1 3 2
4 2 1 3
4 2 3 1
4 3 1 2
4 3 2 1


Output

No
No
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
No
No
No
import java.io.*;
import java.util.StringTokenizer;

public class Main {

    static int T;
    static Entry[] E;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        T = sc.nextInt();
        E = new Entry[T];
        for (int i = 0; i < T; i++) {
            E[i] = new Entry(sc.nextLong(), sc.nextLong(), sc.nextLong(), sc.nextLong());
        }

        PrintWriter pw = new PrintWriter(System.out);
        for (boolean b : solve()) {
            pw.println( b ? "Yes" : "No");
        }
        pw.flush();
    }

    static boolean[] solve() {
        boolean[] answers = new boolean[T];
        for (int i = 0; i < T; i++) {
            answers[i] = calc(E[i]);
        }
        return answers;
    }

    static boolean calc(Entry e) {
        if( e.a < e.b ) return false;
        if( e.d < e.b ) return false;
        if( e.c+1 >= e.b ) return true;

        if( e.b == e.d ) {
            long r = e.a % e.b;
            return r <= e.c;
        }

        long gcd = gcd(e.b, e.d);
        if( gcd == 1 ) return false;

        // 死ぬ範囲
        // e.b > death > e.c
        if( e.b - e.c - 1 >= gcd ) return false; // 死ぬ

        long r = e.a % e.b % gcd;
        if( r == 0 ) return true;

        long c_gcd = e.c % gcd;
        return r <= c_gcd;
    }

    static long gcd(long a, long b) {
        if( b > a ) {
            long t = a;
            a = b;
            b = t;
        }

        if( b == 0 ) return a;

        else return gcd(b, a%b);
    }


    static class Entry {
        long a;
        long b;
        long c;
        long d;

        public Entry(long a, long b, long c, long d) {
            this.a = a;
            this.b = b;
            this.c = c;
            this.d = d;
        }
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;
        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }
        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }
        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
}
