#include<bits/stdc++.h>
#define pi pair<int,int>
#define mod 1000000007
#define ll long long
#define pb push_back
using namespace std;

int main() {
    ll t;
    cin>>t;
    while(t--)
    {
        ll n;cin>>n;
        for(ll i=0;i*2020<=n;i++)
        {
            for(ll j=0;i*2020+j*2021<=n;j++)
            {
                if(i*2020+j*2021==n)
                {
                    cout<<"YES"<<endl;
                    goto x;
                }
            }
        }
        cout<<"NO"<<endl;
        x:
        continue;
    }
    return 0;
}
