#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int t,n;
    cin>>t;
    for(int r=0;r<t;r++)
    {
        cin>>n;
        int k=n%2020,p=n/2020;

        if(k<=p)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }
    return 0;
}
