Polycarp remembered the 2020-th year, and he is happy with the arrival of the new 2021-th year. To remember such a wonderful moment, Polycarp wants to represent the number n as the sum of a certain number of 2020 and a certain number of 2021.

For example, if: 

  * n=4041, then the number n can be represented as the sum 2020 + 2021; 
  * n=4042, then the number n can be represented as the sum 2021 + 2021; 
  * n=8081, then the number n can be represented as the sum 2020 + 2020 + 2020 + 2021; 
  * n=8079, then the number n cannot be represented as the sum of the numbers 2020 and 2021. 



Help Polycarp to find out whether the number n can be represented as the sum of a certain number of numbers 2020 and a certain number of numbers 2021.

Input

The first line contains one integer t (1 ≤ t ≤ 10^4) — the number of test cases. Then t test cases follow.

Each test case contains one integer n (1 ≤ n ≤ 10^6) — the number that Polycarp wants to represent as the sum of the numbers 2020 and 2021.

Output

For each test case, output on a separate line: 

  * "YES" if the number n is representable as the sum of a certain number of 2020 and a certain number of 2021; 
  * "NO" otherwise. 



You can output "YES" and "NO" in any case (for example, the strings yEs, yes, Yes and YES will be recognized as positive).

Example

Input


5
1
4041
4042
8081
8079


Output


NO
YES
YES
YES
NO
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
using namespace std;
 
#define debug(x)	cerr<<(#x)<<" : "<<setprecision(18)<<(x)<<endl;
#define endl '\n'
 
int gcd(int a, int b, int& x, int& y) {
	    if (b == 0) {
		            x = 1;
			            y = 0;
				            return a;
					        }
	        int x1, y1;
		    int d = gcd(b, a % b, x1, y1);
		        x = y1;
			    y = x1 - y1 * (a / b);
			        return d;
}
 
bool find_any_solution(int a, int b, int c, int &x0, int &y0, int &g) {
	    g = gcd(abs(a), abs(b), x0, y0);
	        if (c % g) {
			        return false;
				    }
 
		    x0 *= c / g;
		        y0 *= c / g;
			    if (a < 0) x0 = -x0;
			        if (b < 0) y0 = -y0;
				    return true;
}
 
void shift_solution(int & x, int & y, int a, int b, int cnt) {
	    x += cnt * b;
	        y -= cnt * a;
}
 
int find_all_solutions(int a, int b, int c, int minx, int maxx, int miny, int maxy) {
	    int x, y, g;
	        if (!find_any_solution(a, b, c, x, y, g))
			        return 0;
		    a /= g;
		        b /= g;
 
			    int sign_a = a > 0 ? +1 : -1;
			        int sign_b = b > 0 ? +1 : -1;
 
				    shift_solution(x, y, a, b, (minx - x) / b);
				        if (x < minx)
						        shift_solution(x, y, a, b, sign_b);
					    if (x > maxx)
						            return 0;
					        int lx1 = x;
 
						    shift_solution(x, y, a, b, (maxx - x) / b);
						        if (x > maxx)
								        shift_solution(x, y, a, b, -sign_b);
							    int rx1 = x;
 
							        shift_solution(x, y, a, b, -(miny - y) / a);
								    if (y < miny)
									            shift_solution(x, y, a, b, -sign_a);
								        if (y > maxy)
										        return 0;
									    int lx2 = x;
 
									        shift_solution(x, y, a, b, -(maxy - y) / a);
										    if (y > maxy)
											            shift_solution(x, y, a, b, sign_a);
										        int rx2 = x;
 
											    if (lx2 > rx2)
												            swap(lx2, rx2);
											        int lx = max(lx1, lx2);
												    int rx = min(rx1, rx2);
 
												        if (lx > rx)
														        return 0;
													    return (rx - lx) / abs(b) + 1;
}
 
int main(){
 
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
 
	/*string name;
	cin>>name;
	debug(name);
	debug(M_PI);
	*/
	//Run for the number of specified testcases
	int T;
	cin>>T;
	while(T--){
		int n;
		cin>>n;
 
		cout<<( find_all_solutions(2020,2021,n,0,1000,0,1000) ? "YES" : "NO")<<endl;
	}
	/*
	//stop when both integers are 0
	int a,b;
	while(scanf("%d %d",&a,&b),(a||b)){;}
 
	//checking for EOF
	while(scanf("%d %d",&a,&b)==2){;}	// OR while(scanf("%d %d",&a,&b)!=EOF){;}
	*/
	return 0;
}