#include <bits/stdc++.h>
using namespace std;
bool bis[200000 + 5];
int bakom, n, v;
vector<int> vev, vip, sem;
int x[200000 + 5];
int par[200000 + 5];
int val[200000 + 5];
int fp(int mas) {
  if (mas == par[mas]) {
    return mas;
  }
  return par[mas] = fp(par[mas]);
}
void gabung(int a, int b, int vat) {
  int aa = fp(a);
  int bb = fp(b);
  if (aa == bb) {
    return;
  }
  bakom--;
  assert(b == bb);
  par[bb] = par[aa];
  val[bb] = -1;
  val[aa] = vat;
}
void gakbisa_semua() {
  int i;
  for (i = 1; i <= n; i++) {
    cout << "TIDAK\n";
  }
  return;
}
int main() {
  int i, j;
  cin >> n >> v;
  for (i = 1; i <= n; i++) {
    cin >> x[i];
  }
  stack<int> tum;
  while (v > 0) {
    tum.push(v);
    v >>= 1;
  }
  vev.push_back(0);
  while (!tum.empty()) {
    vev.push_back(tum.top());
    tum.pop();
  }
  for (i = 1; i <= n; i++) {
    par[i] = i;
  }
  bakom = n;
  for (i = 1; i <= (int)vev.size() - 1; i++) {
    for (j = 2; j <= n; j++) {
      if (x[j] - x[j - 1] <= vev[i]) {
        gabung(j - 1, j, min(i, max(val[fp(j - 1)], val[fp(j)]) + 1));
      }
    }
  }
  int telemax = vev.size() - 1;
  if (bakom > telemax + 1) {
    gakbisa_semua();
    return 0;
  }
  for (i = 1; i <= n; i++) {
    if (val[i] != -1) {
      vip.push_back(i);
    }
  }
  for (i = 0; i <= (int)vip.size() - 1; i++) {
    sem.push_back(val[vip[i]]);
  }
  sort(sem.begin(), sem.end());
  int kur;
  for (i = 0; i <= (int)vip.size() - 1; i++) {
    bis[vip[i]] = 1;
    kur = 0;
    for (j = 0; j <= (int)sem.size() - 1; j++) {
      if (kur == 0 && val[vip[i]] == sem[j]) {
        kur = 1;
      } else {
        if (j - kur + telemax - bakom + 1 < sem[j]) {
          bis[vip[i]] = 0;
          break;
        }
      }
    }
  }
  for (i = 1; i <= n; i++) {
    if (bis[fp(i)]) {
      cout << "YA\n";
    } else {
      cout << "TIDAK\n";
    }
  }
}
