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

int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
        ll n;
        cin>>n;
        int flag=0;
        if(n%2020==0||n%2021==0)
        {
            cout<<"YES"<<endl;
            continue;
        }
        for(int i=0;i<500;i++)
        {
            double x;
            x=n-(i*2020);
            x=x/2021;
            if(x-(int)x==0 &&x>0)
            {
               // cout<<x<<endl;
                flag=1;
                break;
            }
        }
        if(flag)
        cout<<"YES"<<endl;
        else
        cout<<"NO"<<endl;
    }
}