#include <bits/stdc++.h>

using namespace std;

#define FREOPEN freopen("in.txt", "r", stdin)


void solve();

int mp[6000000];

void init() {
	int a = 2020, b = 2021;
	for (int i = 0; i < 1010; i++)
		for (int j = 0; j < 1010; j++)
			mp[i * a + j * b] = 1;
}

int main() {
	init();
	//FREOPEN;
	ios::sync_with_stdio(false); cin.tie(0);
	int cases; cin >> cases;
	for (int i = 1; i <= cases; i++)
		solve();
}

typedef long long ll;

const int N = 1e5 + 10, INF = 0x3f3f3f3f, MOD = 1e9 + 7;

int n, m;

void solve() {
	cin >> n;
	if (mp[n]) puts("YES");
	else puts("NO");
}
