#include <bits/stdc++.h>
using namespace std;

#define int long long
#define ff first
#define ss second
#define N 1000005
#define mod 1000000007

void solve(){
    int n;
    cin >> n;
    if ((n%2021)%2020==0){
        cout << "YES";
        return;
    }
    int last = n%10;
    n-=last*2021;
    while (n>=0 && n%2020!=0){
        n-=20210;
    }

    if (n>=0)
        cout << "YES";
    else
        cout << "NO";
}
/*

*/
signed main(){
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    
    int t;
    cin >> t;
    while(t--){
        solve();
        cout << "\n";
    }
}