
// Problem: B. Новогоднее число
// Contest: Codeforces - Codeforces Round #697 (Div. 3)
// URL: http://codeforces.com/contest/1475/problem/B
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
 
using namespace std;

//data types 
#define db long double
#define ll long long 
#define str string 

// pairs 
#define pii pair < int, int >
#define pll pair < ll, ll >
#define pdb pair < db, db>
#define mp make_pair
#define fi first
#define se second

// vectors 
#define vei vector < int > // parkour game 
#define vell vector < ll >
#define vedb vector < db > 
#define pb push_back


//general templates 
#define all(x) x.begin(), x.end()
#define sz(s) int((s).size())
#define sup(a, n) sort(a + 1, a + n + 1); // sup, broo!!!
#define sdown(a, n) sort (a + 1, a + n + 1, greater<>());
#define sll(a) sort(a.begin(), a.end());
#define ret return
#define retz return 0
#define speedup ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define nl "\n"
#define sp ' '

const int N = 1e5 + 123, INF = 1e9;	

void solve() {
	int n;
	cin >> n;
	for (int i = 0; i <= 1000; i++) {
		if (2020 * i > n) 
			break;
		for (int j = 0; j <= 1000; j++) {
			if (2020 * i + 2021 * j == n) {
				cout << "YES" << nl;
				ret;
			}
			if (2020 * i + 2021 * j > n) 
				break;
		}
	}
	cout << "NO" << nl;
}

int main() {
	speedup;

	int t;
	cin >> t;
	while (t--) {
		solve();
	}
}