#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define FL(i,a,b) for(ll i=a;i<b;i++)
int main() {
ll n,k,x;cin>>n>>k;
map<ll,ll> a;
FL(i,0,n){
cin>>x;
ll temp=a.size();
a.insert({x,i});
if(a.size()==temp){
if(a.size()-a[x]<=k){
cout<<x;
return 0;
}
}
}
cout<<"DEPTRY";
}
CiNpbmNsdWRlIDxiaXRzL3N0ZGMrKy5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwp1c2luZyBsbD1sb25nIGxvbmc7CiNkZWZpbmUgRkwoaSxhLGIpIGZvcihsbCBpPWE7aTxiO2krKykKCgppbnQgbWFpbigpIHsKCWxsIG4sayx4O2Npbj4+bj4+azsKCW1hcDxsbCxsbD4gYTsKCUZMKGksMCxuKXsKCQljaW4+Png7CgkJbGwgdGVtcD1hLnNpemUoKTsKCQlhLmluc2VydCh7eCxpfSk7CgkJaWYoYS5zaXplKCk9PXRlbXApewoJCQlpZihhLnNpemUoKS1hW3hdPD1rKXsKCQkJCWNvdXQ8PHg7CgkJCQlyZXR1cm4gMDsKCQkJfQoJCX0KCX0KCWNvdXQ8PCJERVBUUlkiOwoJCn0K