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

#define int long long
#define double long double

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t;
    cin >> t;

    while(t--){
        int n;
        cin >> n;

        int second = n%2020;

        if(n-2021*second >= 0 && (n-2021*second)%2020 == 0){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }

    }
}
