#include <iostream>

using namespace std;

int main()
{
	int num;
	 cin >> num;
	 for(int i = 0; i < num; i++)
	 {
	 	int cas;
	 	cin >> cas;
	 	int kotobar = cas/2020;
	 	if(kotobar == 0)
	 	{
	 		cout << "NO" << endl;
	 		continue;
	 	}
	 	int baki = cas%2020;
	 	if(baki <= kotobar)
	 	{
	 		cout << "YES" << endl;
	 	}
	 	else
	 	{
	 		cout << "NO" << endl;
	 	}
	 }
	return 0;
}