#include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
#define ll long long
template<typename KeyType, typename ValueType> 
std::pair<KeyType,ValueType> get_max( const std::map<KeyType,ValueType>& x ) {
  using pairtype=std::pair<KeyType,ValueType>; 
  return *std::max_element(x.begin(), x.end(), [] (const pairtype & p1, const pairtype & p2) {
        return p1.second < p2.second;
  }); 
}
const int mod=1e9+7;
void solve()
{
	int n;
	cin>>n;
	if(!(n%2021)||!(n%2020))
	{
		cout<<"YES";
		return;
	}
	else
	{
		int chk=n;
		while(chk>=2021)
		{
			
			chk-=2020;
			if(chk%2021==0)
			{
				cout<<"YES";
				return;
			}
		}
	}
	cout<<"NO";
	return;
}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		solve();
		cout<<"\n";
	}
}


