#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define sz(x) x.size()
#define pb push_back
#define mk make_pair
#define tests int t; cin >> t; while(t--)
#define forn(i, a, b) for (int i = a; i < b; i++)

typedef long long ll;
typedef long double ld;

const int Z = (int)1e5 + 123;
const int inf = (int)2e9 + 123;
const ll llinf = (ll)9e18 + 123;

int main() {
    tests {
        int n;
        cin >> n;
        ll a = 0, b = n % 10;
        bool flag = false;
        while ((b * 2021) + (a * 2020) <= n) {
            if ((n - (b * 2021)) % 2020 > 0) {
                b += 10;
                continue;
            } else {
                flag = true;
                break;
            }
        }
        cout << (flag ? "YES\n" : "NO\n");
    }
    return 0;
}
