#include<iostream>
#include<cmath>
#include<vector>
using namespace std;
int main(){
    int t, n;
    cin>>t;
    while(t--){
        cin>>n;
        int b=0;string v="NO";
        if(n%2020==0||n%2021==0){v="YES";}
        else{        while(n-b*2021>=2020){
            
            if((n-b*2021)%2020==0){v="YES";break;}
            b++;
        }}
        cout<<v<<endl;
    }
}