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


int main(){
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        int md=n%(2020);
        int x=n/2020;
        if(md<=x){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
}