#include<iostream>
using namespace std;

bool check(int X,int n,int m){
    return (n*2020 + m*2021 == X);
}

//n*2020 + m*2021 = X
void sol(int X){
    for (int m = 0; m <= X/2021; m++)
    {
        int n;
        n=(X-2021*m)/2020;
        if(check(X,n,m)){
            cout << "YES" << endl;
            return ;
        }
    }
    cout << "NO" << endl;
    return ;
}

int main(){
    int t;
    cin>>t;
    for (int i=0;i<t;i++){
        int X;
        cin >> X;
        sol(X);
    }
    return 0;
}