/****************************************** By Lord Sanskar Bhargava******************************/  


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

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);
    int tt;
    cin>>tt;
    while(tt--)
    {
      ll n;cin>>n;
    ll k=n%2020;
      if(n<2020)
      {
        cout<<"NO"<<endl;
      }
      else if(k*2021<=n)
      {
        cout<<"YES"<<endl;
      }
      else
      {
        cout<<"NO"<<endl;
      }

    }
return 0;
}