#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
#include <cmath>
#include <queue>
#include <set>
#include <bitset>

using namespace std;

typedef long long ll;
ll MOD = 1000000007;

void solve(int testCase)
{
	ll n;
	cin >> n;
	for (int i = 0; i * 2020 <= n; i++)
	{
		if ((n - i * 2020) % 2021 == 0)
		{
			cout << "YES" << endl;
			return;
		}
	}
	cout << "NO" << endl;

}
 
int main()
{
	int t;
	cin >> t;
	//t = 1;
	int i = 1;
	while (t--)
	{
		solve(i++);
	}
	return 0;
}