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

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

#define lp(i, a, b) for (int i=a; i<(b); i++)
#define lpd(i,a,b) for (int i = (b)-1; i >= a; i--)

#define sz(x) (int)(x).size()
#define all(x) x.begin(), x.end()
#define mp make_pair
#define pb push_back

typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;

vi primeDivisors;
vector<pair<int, int> > v, v1;
int n, k;
const int NMAX = 1e5+1;

void sieve() {
    for (int i=2;i*i<=NMAX;++i){
        if (primeDivisors[i] == -1){
            for (int j=i*i;j<=NMAX;j+=i){
                if (primeDivisors[j] == -1)
                    primeDivisors[j] = i;
            }
        }
    }
    for (int i=1;i<=NMAX;++i)
        if (primeDivisors[i] == -1)
            primeDivisors[i] = i;
}

void decompose(int n) {
    v.clear();
    v1.clear();
    while (n > 1) {
        int cnt = 0;
        int d = primeDivisors[n];
        while (n%d == 0) {
            cnt++;
            n /= d;
        }
        if (cnt % k > 0 ) {
            v.pb({d, cnt%k});
            v1.pb({d, k - cnt%k});
        }
    }
}

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

    cin>>n>>k;
    primeDivisors = vi(NMAX+1, -1);
    sieve();
    int a;
    map<vector<pair<int, int> >, int> mp;
    ll ans = 0;

    lp(i, 0, n) {
        cin>>a;
        decompose(a);
        ans += (ll)mp[v1];
        mp[v]++;
    }
    cout<<ans<<endl;

    return 0;
}


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

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

#define lp(i, a, b) for (int i=a; i<(b); i++)
#define lpd(i,a,b) for (int i = (b)-1; i >= a; i--)

#define sz(x) (int)(x).size()
#define all(x) x.begin(), x.end()
#define mp make_pair
#define pb push_back

typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;

vi primeDivisors;
int n, k;
const int NMAX = 1e5+1;

void sieve() {
    for (int i=2;i*i<=NMAX;++i){
        if (primeDivisors[i] == -1){
            for (int j=i*i;j<=NMAX;j+=i){
                if (primeDivisors[j] == -1)
                    primeDivisors[j] = i;
            }
        }
    }
    for (int i=1;i<=NMAX;++i)
        if (primeDivisors[i] == -1)
            primeDivisors[i] = i;
}

vector<pair<int, int> > decompose(int n) {
    vector<pair<int, int> > v;
    while (n > 1) {
        int cnt = 0;
        int d = primeDivisors[n];
        while (n%d == 0) {
            cnt++;
            n /= d;
        }
        if (cnt % k > 0 ) v.pb({d, cnt%k});
    }
    return v;
}

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

    cin>>n>>k;
    primeDivisors = vi(NMAX+1, -1);
    sieve();
    int a;
    map<vector<pair<int, int> >, int> mp;
    ll ans = 0;

    lp(i, 0, n) {
        cin>>a;
        vector<pair<int, int> > v = decompose(a);
        vector<pair<int, int> > v1 = v;
        //debug(a, v, v1);
        int len =sz(v1);

        for (int j=0;j<len;++j)
            v1[j].second = k - v1[j].second;

        ans += (ll)mp[v1];
        mp[v]++;
    }
    cout<<ans<<endl;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

#define lp(i, a, b) for (int i=a; i<(b); i++)
#define lpd(i,a,b) for (int i = (b)-1; i >= a; i--)

#define sz(x) (int)(x).size()
#define all(x) x.begin(), x.end()
#define mp make_pair
#define pb push_back

typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;

int n, k;

vector<pair<int, int> > decompose(int n){
    vector<pair<int, int > > v;
    for (int i=2;i*i<=n;++i){
        int cnt = 0;
        while (n%i == 0){
            cnt++;
            n/=i;
        }
        if (cnt%k > 0) v.pb({i, cnt%k});
    }
    if (n > 1) v.push_back({n, 1});
    return v;
}

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

    cin>>n>>k;
    int a;
    map<vector<pair<int, int> >, int > mp;
    int ans = 0;
    lp(i, 0, n) {
        cin>>a;
        vector<pair<int, int> > v = decompose(a);
        vector<pair<int, int> > v1 = v;
        int len = sz(v1);
        lp(i, 0, len) v[i].second = k - v[i].second;
        debug(a, v1, mp[v1]);
        ans += mp[v1];
        mp[v]++;
    }
    cout<<ans<<endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define maxn 100005
#define maxm 200005
#define int long long
#define inf 0x3f3f3f3f
#define mod 1000000007
#define local
template<typename Tp>
void read(Tp &x){
	x=0;int f=1;char c=getchar();
	while(c>'9'||c<'0'){if(c=='-'){f=-1;}c=getchar();}
	while(c>='0'&&c<='9'){x=(x<<1)+(x<<3)+(c^48);c=getchar();}x*=f;
}
int n,m;
int h[maxn],sum;
vector<int>v[maxn];
int pp[maxn],ppn[maxn],tot,lim;
int ksm(int b,int p){
	int ret=1;
	while(p){
		if(p&1)ret=ret*b;
		b=b*b;
		p>>=1;
	}
	return ret;
}
void process(int x){
	int xx=x;
	for(int i=2;i*i<=xx;i++){
		if(xx%i==0){
			ppn[++tot]=i;pp[tot]=0;
			while(xx%i==0)xx/=i,pp[tot]++;
		}
	}
	if(xx>1)ppn[++tot]=xx,pp[tot]=1;
	int els=1;
	for(int i=1;i<=tot;i++){
			int tmp=pp[i];
			tmp=tmp%m;tmp=(m-tmp)%m;
			els*=ksm(ppn[i],tmp);
	}
	for(int i=1;i<=lim;i++){
		if(els*ksm(i,m)>100000)break;
		v[x].push_back(els*ksm(i,m));
	}
	tot=0;
}
signed main(){
	#ifndef local
		file("");
	#endif
	int a;
	read(n);read(m);
	lim=pow(100000.0,1.0/m);
	if(m<=33){
		for(int i=1;i<=100000;i++){
			process(i);
		}
	}
	else v[1].push_back(1);
	for(int i=1;i<=n;i++)read(a),h[a]++;
	for(int i=1;i<=100000;i++){
		if(!h[i])continue;
		for(int j=0;j<v[i].size();j++){
			int tmp=v[i][j];
			if(i!=tmp)sum+=h[i]*h[tmp];
			else sum+=h[i]*(h[i]-1);
		}
	}
	cout<<sum/2<<endl;
	#ifndef local
	fclose(stdin);fclose(stdout);
	#endif
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define maxn 100005
#define maxm 200005
#define int long long
#define inf 0x3f3f3f3f
#define mod 1000000007
#define local
template<typename Tp>
void read(Tp &x){
	x=0;int f=1;char c=getchar();
	while(c>'9'||c<'0'){if(c=='-'){f=-1;}c=getchar();}
	while(c>='0'&&c<='9'){x=(x<<1)+(x<<3)+(c^48);c=getchar();}x*=f;
}
int n,m;
int h[maxn],sum;
vector<int>v[maxn];
int pp[maxn],ppn[maxn],tot,lim;
int ksm(int b,int p){
	int ret=1;
	while(p){
		if(p&1)ret=ret*b;
		b=b*b;
		p>>=1;
	}
	return ret;
}
void process(int x){
	int xx=x;
	for(int i=2;i*i<=xx;i++){
		if(xx%i==0){
			ppn[++tot]=i;pp[tot]=0;
			while(xx%i==0)xx/=i,pp[tot]++;
		}
	}
	if(xx>1)ppn[++tot]=xx,pp[tot]=1;
	int els=1;
	for(int i=1;i<=tot;i++){
			int tmp=pp[i];
			tmp=tmp%m;tmp=(m-tmp)%m;
			els*=ksm(ppn[i],tmp);
	}
	lim=pow(100000.0/els,1.0/m);
	for(int i=1;i<=lim;i++){
		if(els*ksm(i,m)>100000)break;
		v[x].push_back(els*ksm(i,m));
	}
	tot=0;
}
signed main(){
	#ifndef local
		file("");
	#endif
	int a;
	read(n);read(m);
//	lim=pow(100000.0,1.0/m);
	if(m<=33){
		for(int i=1;i<=100000;i++){
			process(i);
		}
	}
	else v[1].push_back(1);
	for(int i=1;i<=n;i++)read(a),h[a]++;
	for(int i=1;i<=100000;i++){
		if(!h[i])continue;
		for(int j=0;j<v[i].size();j++){
			int tmp=v[i][j];
			if(i!=tmp)sum+=h[i]*h[tmp];
			else sum+=h[i]*(h[i]-1);
		}
	}
	cout<<sum/2<<endl;
	#ifndef local
	fclose(stdin);fclose(stdout);
	#endif
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define maxn 100005
#define maxm 200005
#define int long long
#define inf 0x3f3f3f3f
#define mod 1000000007
#define local
template<typename Tp>
void read(Tp &x){
	x=0;int f=1;char c=getchar();
	while(c>'9'||c<'0'){if(c=='-'){f=-1;}c=getchar();}
	while(c>='0'&&c<='9'){x=(x<<1)+(x<<3)+(c^48);c=getchar();}x*=f;
}
int n,m;
int h[maxn],sum;
vector<int>v[maxn];
int pp[maxn],ppn[maxn],tot;
int ksm(int b,int p){
	int ret=1;
	while(p){
		if(p&1)ret=ret*b;
		b=b*b;
		p>>=1;
	}
	return ret;
}
void process(int x){
	int xx=x;
	for(int i=2;i*i<=xx;i++){
		if(xx%i==0){
			ppn[++tot]=i;pp[tot]=0;
			while(xx%i==0)xx/=i,pp[tot]++;
		}
	}
	if(xx>1)ppn[++tot]=xx,pp[tot]=1;
	int els=1;
	for(int i=1;i<=tot;i++){
			int tmp=pp[i];
			tmp=tmp%m;tmp=(m-tmp)%m;
			els*=ksm(ppn[i],tmp);
	}
	for(int i=1;;i++){
		if(els*ksm(i,m)>100000)break;
		v[x].push_back(els*ksm(i,m));
	}
	tot=0;
}
signed main(){
	#ifndef local
		file("");
	#endif
	int a;
	read(n);read(m);
	for(int i=1;i<=100000;i++){
		process(i);
	}
	for(int i=1;i<=n;i++)read(a),h[a]++;
	for(int i=1;i<=100000;i++){
		if(!h[i])continue;
		for(int j=0;j<v[i].size();j++){
			int tmp=v[i][j];
			if(i!=tmp)sum+=h[i]*h[tmp];
			else sum+=h[i]*(h[i]-1);
		}
	}
	cout<<sum/2<<endl;
	#ifndef local
	fclose(stdin);fclose(stdout);
	#endif
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define maxn 100005
#define maxm 200005
#define int long long
#define inf 0x3f3f3f3f
#define mod 1000000007
#define local
template<typename Tp>
void read(Tp &x){
	x=0;int f=1;char c=getchar();
	while(c>'9'||c<'0'){if(c=='-'){f=-1;}c=getchar();}
	while(c>='0'&&c<='9'){x=(x<<1)+(x<<3)+(c^48);c=getchar();}x*=f;
}
int n,m;
int h[maxn],sum;
vector<int>v[maxn];
int pp[maxn],ppn[maxn],tot,lim;
int ksm(int b,int p){
	int ret=1;
	while(p){
		if(p&1)ret=ret*b;
		b=b*b;
		p>>=1;
	}
	return ret;
}
void process(int x){
	int xx=x;
	for(int i=2;i*i<=xx;i++){
		if(xx%i==0){
			ppn[++tot]=i;pp[tot]=0;
			while(xx%i==0)xx/=i,pp[tot]++;
		}
	}
	if(xx>1)ppn[++tot]=xx,pp[tot]=1;
	int els=1;
	for(int i=1;i<=tot;i++){
			int tmp=pp[i];
			tmp=tmp%m;tmp=(m-tmp)%m;
			els*=ksm(ppn[i],tmp);
	}
	lim=pow(100000.0/els,1.0/m);
	for(int i=1;i<=lim||(m<=10);i++){
		if(els*ksm(i,m)>100000)break;
		v[x].push_back(els*ksm(i,m));
	}
	tot=0;
}
signed main(){
	#ifndef local
		file("");
	#endif
	int a;
	read(n);read(m);
//	lim=pow(100000.0,1.0/m);
	if(m<=33){
		for(int i=1;i<=100000;i++){
			process(i);
		}
	}
	else v[1].push_back(1);
	for(int i=1;i<=n;i++)read(a),h[a]++;
	for(int i=1;i<=100000;i++){
		if(!h[i])continue;
		for(int j=0;j<v[i].size();j++){
			int tmp=v[i][j];
			if(i!=tmp)sum+=h[i]*h[tmp];
			else sum+=h[i]*(h[i]-1);
		}
	}
	cout<<sum/2<<endl;
	#ifndef local
	fclose(stdin);fclose(stdout);
	#endif
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define maxn 100005
#define maxm 200005
#define int long long
#define inf 0x3f3f3f3f
#define mod 1000000007
#define local
template<typename Tp>
void read(Tp &x){
	x=0;int f=1;char c=getchar();
	while(c>'9'||c<'0'){if(c=='-'){f=-1;}c=getchar();}
	while(c>='0'&&c<='9'){x=(x<<1)+(x<<3)+(c^48);c=getchar();}x*=f;
}
int n,m;
int h[maxn],sum;
vector<int>v[maxn];
int pp[maxn],ppn[maxn],tot;
int ksm(int b,int p){
	int ret=1;
	while(p){
		if(p&1)ret=ret*b;
		b=b*b;
		p>>=1;
	}
	return ret;
}
void process(int x){
	int xx=x;
	for(int i=2;i*i<=xx;i++){
		if(xx%i==0){
			ppn[++tot]=i;pp[tot]=0;
			while(xx%i==0)xx/=i,pp[tot]++;
		}
	}
	if(xx>1)ppn[++tot]=xx,pp[tot]=1;
	int els=1;
	for(int i=1;i<=tot;i++){
			int tmp=pp[i];
			tmp=tmp%m;tmp=(m-tmp)%m;
			els*=ksm(ppn[i],tmp);
	}
	for(int i=1;;i++){
		if((i==2&&m>34)||els*ksm(i,m)>100000)break;
		v[x].push_back(els*ksm(i,m));
	}
	tot=0;
}
signed main(){
	#ifndef local
		file("");
	#endif
	int a;
	read(n);read(m);
	for(int i=1;i<=100000;i++){
		process(i);
	}
	for(int i=1;i<=n;i++)read(a),h[a]++;
	for(int i=1;i<=100000;i++){
		if(!h[i])continue;
		for(int j=0;j<v[i].size();j++){
			int tmp=v[i][j];
			if(i!=tmp)sum+=h[i]*h[tmp];
			else sum+=h[i]*(h[i]-1);
		}
	}
	cout<<sum/2<<endl;
	#ifndef local
	fclose(stdin);fclose(stdout);
	#endif
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fore(i, a, b) for (Long i = a, to = b; i < to; i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define SZ(v) (int)v.size()
#define pb push_back
typedef long long Long;
typedef pair<Long, Long> Pair;
const int MX = (1e5 + 2);
const Long INF = (1e12);
Long f[MX];
void init() {
  for (Long i = 2; i * i < MX; i++) {
    if (f[i] == 0) {
      for (Long j = i * i; j < MX; j += i) f[j] = i;
    }
  }
  for (Long i = 1; i < MX; i++)
    if (f[i] == 0) f[i] = i;
}
Long A[MX];
Long n, k;
void add() {
  Long num;
  cin >> num;
  Long realNum = 1;
  while (num > 1) {
    Long pr = f[num];
    Long cnt = 0;
    while (num % pr == 0) {
      num /= pr;
      cnt++;
    }
    cnt %= k;
    fore(i, 0, cnt) realNum *= pr;
  }
  A[realNum]++;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  init();
  cin >> n >> k;
  fore(i, 0, n) add();
  Long ans = 0;
  if (k == 2) {
    fore(i, 1, MX) ans += (A[i] * (A[i] - 1) / 2);
  } else {
    vector<Long> values;
    fore(i, 1, MX) {
      Long cur = i;
      fore(j, 1, k) {
        cur *= i;
        if (cur >= INF) cur = INF;
      }
      if (cur < INF) values.pb(cur);
    }
    sort(all(values));
    // cout << SZ(values) << endl;
    ans += (A[1] * (A[1] - 1) / 2);
    fore(i, 2, MX) {
      if (A[i] > 0) {
        int p = lower_bound(all(values), i * i) - values.begin();
        for (p; p < SZ(values); p++) {
          Long &x = values[p];
          if (x % i > 0) continue;
          if (x / i >= MX) continue;
          ans += (A[i] * A[x / i]);
        }
      }
    }
  }
  cout << ans << endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fore(i, a, b) for (Long i = a, to = b; i < to; i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define SZ(v) (int)v.size()
#define pb push_back
typedef long long Long;
typedef pair<Long, Long> Pair;
const int MX = (1e5 + 2);
const Long INF = (1e12);
Long f[MX];
void init() {
  for (Long i = 2; i * i < MX; i++) {
    if (f[i] == 0) {
      for (Long j = i * i; j < MX; j += i) f[j] = i;
    }
  }
  for (Long i = 1; i < MX; i++)
    if (f[i] == 0) f[i] = i;
}
Long A[MX];
Long n, k;
void add() {
  Long num;
  cin >> num;
  Long realNum = 1;
  while (num > 1) {
    Long pr = f[num];
    Long cnt = 0;
    while (num % pr == 0) {
      num /= pr;
      cnt++;
    }
    cnt %= k;
    fore(i, 0, cnt) realNum *= pr;
  }
  A[realNum]++;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  init();
  cin >> n >> k;
  fore(i, 0, n) add();
  Long ans = 0;
  if (k == 2) {
    fore(i, 1, MX) ans += (A[i] * (A[i] - 1) / 2);
  } else {
    vector<Long> values;
    fore(i, 1, MX) {
      Long cur = i;
      fore(j, 1, k) {
        cur *= i;
        if (cur >= INF) cur = INF;
      }
      if (cur < INF) values.pb(cur);
    }
    sort(all(values));
    // cout << SZ(values) << endl;
    fore(i, 1, MX) {
      if (A[i] > 0) {
        int p = lower_bound(all(values), i * i) - values.begin();
        for (p; p < SZ(values); p++) {
          Long &x = values[p];
          if (x % i > 0) continue;
          if (x / i >= MX) continue;
          if (i == x / i)
            ans += (A[i] * (A[i] - 1) / 2);
          else
            ans += (A[i] * A[x / i]);
        }
      }
    }
  }
  cout << ans << endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fore(i, a, b) for (Long i = a, to = b; i < to; i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define SZ(v) (int)v.size()
#define pb push_back
typedef long long Long;
typedef pair<Long, Long> Pair;
const int MX = (1e5 + 2);
const Long INF = (1e12);
Long f[MX];
void init() {
  for (Long i = 2; i * i <= MX; i++) {
    if (f[i] == 0) {
      for (Long j = i * i; j <= MX; j += i) f[j] = i;
    }
  }
  for (Long i = 1; i <= MX; i++)
    if (f[i] == 0) f[i] = i;
}
Long A[MX];
Long n, k;
void add() {
  Long num;
  cin >> num;
  Long realNum = 1;
  while (num > 1) {
    Long pr = f[num];
    Long cnt = 0;
    while (num % pr == 0) {
      num /= pr;
      cnt++;
    }
    cnt %= k;
    fore(i, 0, k) realNum *= pr;
  }
  A[realNum]++;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  init();
  cin >> n >> k;
  fore(i, 0, n) add();
  Long ans = 0;
  if (k == 2) {
    fore(i, 1, MX) ans += (A[i] * (A[i] - 1));
  } else {
    unordered_set<Long> values;
    fore(i, 1, MX) {
      Long cur = i;
      fore(j, 0, k) {
        cur *= i;
        if (cur >= INF) cur = INF;
      }
      if (cur < INF) values.insert(cur);
    }
    // cout << SZ(values) << endl;
    fore(i, 1, MX) {
      for (Long x : values) {
        // cout << x << endl;
        if (i % x > 0) continue;
        ans += (A[i] * A[i / x]);
      }
    }
  }
  cout << ans / 2 << endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fore(i, a, b) for (Long i = a, to = b; i < to; i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define SZ(v) (int)v.size()
#define pb push_back
typedef long long Long;
typedef pair<Long, Long> Pair;
const int MX = (1e5 + 2);
const Long INF = (1e12);
Long f[MX];
void init() {
  for (Long i = 2; i * i < MX; i++) {
    if (f[i] == 0) {
      for (Long j = i * i; j < MX; j += i) f[j] = i;
    }
  }
  for (Long i = 1; i < MX; i++)
    if (f[i] == 0) f[i] = i;
}
Long A[MX];
Long n, k;
void add() {
  Long num;
  cin >> num;
  Long realNum = 1;
  while (num > 1) {
    Long pr = f[num];
    Long cnt = 0;
    while (num % pr == 0) {
      num /= pr;
      cnt++;
    }
    cnt %= k;
    fore(i, 0, cnt) realNum *= pr;
  }
  A[realNum]++;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  init();
  cin >> n >> k;
  fore(i, 0, n) add();
  Long ans = 0;
  if (k == 2) {
    fore(i, 1, MX) ans += (A[i] * (A[i] - 1));
  } else {
    unordered_set<Long> values;
    fore(i, 1, MX) {
      Long cur = i;
      fore(j, 0, k) {
        cur *= i;
        if (cur >= INF) cur = INF;
      }
      if (cur < INF) values.insert(cur);
    }
    // cout << SZ(values) << endl;
    fore(i, 1, MX) {
      for (Long x : values) {
        // cout << x << endl;
        if (i % x > 0) continue;
        ans += (A[i] * A[i / x]);
      }
    }
  }
  cout << ans / 2 << endl;

  return 0;
}


import java.math.*;
import java.io.*;
import java.util.*;
public class VKCUP2
{
	StringTokenizer st;
	BufferedReader in;
	PrintWriter ob;
	public static void main(String args[])throws IOException {
		new VKCUP2().run();
	}
	void run()throws IOException  {
		//in=new BufferedReader(new FileReader("input.txt"));
		//ob=new PrintWriter("output.txt");
		in=new BufferedReader(new InputStreamReader(System.in));
		ob=new PrintWriter(System.out);
		solve();
		ob.flush();
	}
	void solve()throws IOException {
		read();
		int n=ni();
		int k=ni();
		int q=ni();
		read();
		int a[]=new int[n+1];
		for(int i=1;i<=n;i++)
			a[i]=ni();
		TreeSet<Node> ts=new TreeSet<Node>(new Comparator<Node>(){
			public int compare(Node a,Node b){
				return a.t-b.t;
			}
		});
		boolean vis[]=new boolean[n+1];
		int ele=0;
		while(q-->0){
			read();
			int id=ni();
			int m=ni();
			if(id==1){
					if(ts.isEmpty()==true || k>ele){
						Node temp=new Node();
						temp.v=m;
						temp.t=a[m];
						vis[m]=true;
						ts.add(temp);
						ele+=1;
					}
					else{
						Node z=ts.first();
						if(z.t<a[m]){
							vis[z.v]=false;
							ts.remove((Node)z);
							Node x=new Node();
							x.v=m;
							x.t=a[m];
							ts.add(x);
							vis[m]=true;
						}
					}
			}
			else{
					ob.println(vis[m]==true?"YES":"NO");
			}
		}
	}
	void read()throws IOException  {
		st=new StringTokenizer(in.readLine());
	}
	int ni(){
		return Integer.parseInt(st.nextToken());
	}
	long nl(){
		return Long.parseLong(st.nextToken());
	}
	double nd(){
		return Double.parseDouble(st.nextToken());
	}
	String ns(){
		return st.nextToken();
	}
	char nc(){
		return st.nextToken().charAt(0);
	}
	int[] nia(int n)throws IOException {
		int a[]=new int[n];
		read();
		for(int i=0;i<n;i++){
			a[i]=Integer.parseInt(st.nextToken());
		}
		return a;
	}
	long[] nla(int n)throws IOException {
		long a[]=new long[n];
		read();
		for(int i=0;i<n;i++){
			a[i]=Long.parseLong(st.nextToken());
		}
		return a;
	}
}
class Node{
	int v;
	int t;
}


//package vkcup;

import java.util.Scanner;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;
import java.io.IOException;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.Map;
import java.util.PriorityQueue;
public class b{
	public static void main(String args[]){
		FasterScanner sc=new FasterScanner();
		PrintWriter out=new PrintWriter(System.out);
		int n=sc.nextInt();
		int k=sc.nextInt();
		int q=sc.nextInt();
		int t[]=sc.nextIntArray(n);
		boolean[] online = new boolean[n];
		TreeSet<Node> tree = new TreeSet<>();

		while(q-->0)
		{
			int a=sc.nextInt();
			int id=sc.nextInt();
			if(a==1)
			{
				if(tree.size()<k){
					tree.add(new Node(id,t[id-1]));
				}
				else{
					Node temp = tree.first();
					if(temp.t<t[id-1]){
						tree.remove(temp);
						tree.add(new Node(id, t[id-1]));
					}
				}
			}
			else{
				boolean ans = tree.contains(new Node(id, t[id-1]));
				if(ans){
					out.println("YES");
				}
				else{
					out.println("NO");
				}
			}
		}

		out.close();
	}

	public static boolean isDoublePalindrome(String string) {
	    int length = string.length();
	    // if length is not even, then it is not a double palindrome
	    if (length % 2 != 0) {
	      return false;
	    }
	    int start = 0;
	    int end = length - 1;
	    int middle = (end - start) / 2;
	    while (start < middle) {
	      // if characters are same, move the pointers, otherwise break and
	      // return false
	      if ((string.charAt(start) == string.charAt(middle))
	          && (string.charAt(start) == string.charAt(end))) {
	        start++;
	        middle--;
	        end--;
	      } else {
	        return false;
	      }
	    }
	    return true;
	}
	public static void swap(int i,int j){
		int t=i;
		i=j;
		j=t;
	}

	public static class FasterScanner {

		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public int read() {
			if (numChars == -1) {
				throw new InputMismatchException();
			}
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = System.in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0) {
					return -1;
				}
			}
			return buf[curChar++];
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public String nextString() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9') {
					throw new InputMismatchException();
				}
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9') {
					throw new InputMismatchException();
				}
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray(int n) {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}

		private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
	}

}

class Node implements Comparable<Node>{
	int id;
	int t;
	public Node(int id,int t){
		this.id = id;
		this.t = t;
	}
	@Override
	public int compareTo(Node o) {
		// TODO Auto-generated method stub
		return this.t-o.t;
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class VK_B {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = Math.min(6, sc.nextInt());
		int q = sc.nextInt();
		int[] p = new int[n];
		for (int i = 0; i < p.length; i++) {
			p[i]=sc.nextInt();
		}
//		System.out.println(Arrays.toString(p));
//		int counter = 0;
//		TreeMap<Integer, Boolean> tree = new TreeMap<>();
		TreeSet<Integer> tree = new TreeSet<>();
		for (int i = 0; i < q; i++) {
			int type = sc.nextInt();
			int ID = sc.nextInt();
			if(type == 1 ){
//				tree.add(ID);
				if(tree.size()>=k){
				for(int v:tree){
					//int v = tree.first();
					if(p[v-1]<p[ID-1])
					{
						tree.remove(v);
						tree.add(ID);
						break;

					}
				}
				}
				else
					tree.add(ID);
			}
			else
				if(tree.contains(ID))
					System.out.println("YES");
				else
					System.out.println("NO");

		}
//		for(int i: tree)
//			System.out.println(i);
//		int m = Math.min(6, k);

	}

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException
		{
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if(x.charAt(0) == '-')
			{
				neg = true;
				start++;
			}
			for(int i = start; i < x.length(); i++)
				if(x.charAt(i) == '.')
				{
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				}
				else
				{
					sb.append(x.charAt(i));
					if(dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg?-1:1);
		}

		public boolean ready() throws IOException {return br.ready();}

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class VK_B {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int q = sc.nextInt();
		int[] p = new int[n];
		for (int i = 0; i < p.length; i++) {
			p[i]=sc.nextInt();
		}
//		System.out.println(Arrays.toString(p));
//		int counter = 0;
//		TreeMap<Integer, Boolean> tree = new TreeMap<>();
		TreeSet<Integer> tree = new TreeSet<>();
		for (int i = 0; i < q; i++) {
			int type = sc.nextInt();
			int ID = sc.nextInt();
			if(type == 1 ){
//				tree.add(ID);
				if(tree.size()>=k){
				for(int v:tree){
					//int v = tree.first();
					if(p[v-1]<p[ID-1])
					{
						tree.remove(v);
						tree.add(ID);
						break;

					}
				}
				}
				else
					tree.add(ID);
			}
			else
				if(tree.contains(ID))
					System.out.println("YES");
				else
					System.out.println("NO");

		}
//		for(int i: tree)
//			System.out.println(i);
//		int m = Math.min(6, k);

	}

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException
		{
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if(x.charAt(0) == '-')
			{
				neg = true;
				start++;
			}
			for(int i = start; i < x.length(); i++)
				if(x.charAt(i) == '.')
				{
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				}
				else
				{
					sb.append(x.charAt(i));
					if(dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg?-1:1);
		}

		public boolean ready() throws IOException {return br.ready();}

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class VK_B {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = Math.min(6, sc.nextInt());
		int q = sc.nextInt();
		long[] p = new long[n];
		for (int i = 0; i < p.length; i++) {
			p[i]=sc.nextLong();
		}
//		System.out.println(Arrays.toString(p));
//		int counter = 0;
//		TreeMap<Integer, Boolean> tree = new TreeMap<>();
		TreeSet<Integer> tree = new TreeSet<>();
		for (int i = 0; i < q; i++) {
			int type = sc.nextInt();
			int ID = sc.nextInt();
			if(type == 1 ){
//				tree.add(ID);
				if(tree.size()>=k){
				for(int v:tree){
					//int v = tree.first();
					if(p[v-1]<p[ID-1])
					{
						tree.remove(v);
						tree.add(ID);
						break;

					}
				}
				}
				else
					tree.add(ID);
			}
			else
				if(tree.contains(ID))
					System.out.println("YES");
				else
					System.out.println("NO");

		}
//		for(int i: tree)
//			System.out.println(i);
//		int m = Math.min(6, k);

	}

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException
		{
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if(x.charAt(0) == '-')
			{
				neg = true;
				start++;
			}
			for(int i = start; i < x.length(); i++)
				if(x.charAt(i) == '.')
				{
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				}
				else
				{
					sb.append(x.charAt(i));
					if(dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg?-1:1);
		}

		public boolean ready() throws IOException {return br.ready();}

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class VK_B {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = Math.min(6, sc.nextInt());
		int q = sc.nextInt();
		long[] p = new long[n];
		for (int i = 0; i < p.length; i++) {
			p[i]=sc.nextLong();
		}
//		System.out.println(Arrays.toString(p));
//		int counter = 0;
//		TreeMap<Integer, Boolean> tree = new TreeMap<>();
		TreeSet<Integer> tree = new TreeSet<>();
		for (int i = 0; i < q; i++) {
			int type = sc.nextInt();
			int ID = sc.nextInt();
			if(type == 1 ){
//				tree.add(ID);
				if(tree.size()>=k){
					long min = Integer.MAX_VALUE;
					int minID = 0;
				for(int v:tree){
					//int v = tree.first();
					//min = Math.min(min, v);
					if(p[v-1]<min){
						min = p[v-1];
						minID = v;
					}

				}
//				System.out.println(min);
//				System.out.println(p[ID-1]);
//				System.out.println(minID);
				if(min<p[ID-1]){
					tree.remove(minID);
					tree.add(ID);
				}
				}
				else
					tree.add(ID);
			}
			else
				if(tree.contains(ID))
					System.out.println("YES");
				else
					System.out.println("NO");

		}
//		for(int i: tree)
//			System.out.println(i);
//		int m = Math.min(6, k);

	}

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException
		{
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if(x.charAt(0) == '-')
			{
				neg = true;
				start++;
			}
			for(int i = start; i < x.length(); i++)
				if(x.charAt(i) == '.')
				{
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				}
				else
				{
					sb.append(x.charAt(i));
					if(dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg?-1:1);
		}

		public boolean ready() throws IOException {return br.ready();}

	}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.*;

public class Main
{

	public static void main(String []args)
	throws IOException
	{

		BufferedReader reader = new BufferedReader(
			new InputStreamReader(System.in));

		String []arr = reader.readLine().split(" ");
		int n = Integer.parseInt(arr[0]);
		int k = Integer.parseInt(arr[1]);
		int q = Integer.parseInt(arr[2]);

		arr = reader.readLine().split(" ");

		int []ids = new int[n + 1];
		for (int i=0;i < n;++i)
		{
			ids[i + 1] = Integer.parseInt(arr[i]);
		}

		StringBuilder ans = new StringBuilder();

		int count = 0;
		PriorityQueue<Pair> pq = new PriorityQueue<Pair>();
		boolean []flag = new boolean[n + 1];

		for (int i=1;i <= q;++i)
		{
			arr = reader.readLine().split(" ");
			int type = Integer.parseInt(arr[0]);
			int id = Integer.parseInt(arr[1]);

			if (type == 1)
			{
				pq.add(new Pair(ids[id],id));
				++count;
				flag[id] = true;

				if (count > k)
				{
					--count;
					flag[pq.poll().id] = false;
				}

			}
			else
			{
				if (flag[id])
					ans.append("YES");
				else
					ans.append("NO");
				ans.append("\n");
			}

		}

		System.out.println(ans.toString());

	}

}

class Pair implements Comparable<Pair>
{

	int val,id;

	public Pair(int val, int id)
	{
		this.val = val;
		this.id = id;
	}

	@Override
	public int compareTo(Pair p1)
	{
		// TODO: Implement this method
		return this.val - p1.val;
	}

}


import java.util.Scanner;
import java.util.TreeMap;

public class BearDisplayedFriends {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int k = in.nextInt();
		int q = in.nextInt();

		int[] friends = new int[n];
		TreeMap<Integer, Integer> friendList = new TreeMap<>();
		for (int i = 0; i < n; i++) {
			friends[i] = in.nextInt();
		}

		for (int i = 0; i < q; i++) {
			int type = in.nextInt();
			int id = in.nextInt();
			if (type == 1) {
				if (friendList.size() < k) {
				friendList.put(friends[id-1], id);
				} else {
					friendList.put(friends[id-1], id);
					friendList.pollFirstEntry().getKey();
				}
			} else {
				if (friendList.containsValue(id)) {
					System.out.println("YES");
				} else {
					System.out.println("NO");
				}
			}
		}
		return;
	}
}


import java.util.Scanner;
import java.util.TreeMap;

public class BearDisplayedFriends {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int k = in.nextInt();
		int q = in.nextInt();

		int[] friends = new int[n];
		TreeMap<Integer, Integer> friendList = new TreeMap<>();
		for (int i = 0; i < n; i++) {
			friends[i] = in.nextInt();
		}

		for (int i = 0; i < q; i++) {
			int type = in.nextInt();
			int id = in.nextInt();
			if (type == 1) {
				if (friendList.size() < k) {
				friendList.put(friends[id-1], id);
				} else {
					friendList.pollFirstEntry().getKey();
				}
			} else {
				if (!friendList.containsValue(id)) {
					System.out.println("NO");
				} else {
					System.out.println("YES");
				}
			}
		}
		return;
	}
}


import java.io.*;
import java.util.ArrayList;
import java.util.InputMismatchException;
import java.util.LinkedList;

public class Cf2803B {
    private static InputReader in = new InputReader(System.in);
    private static OutputWriter out = new OutputWriter(System.out);

    private static void solve() throws Exception {
        int n = in.readInt();
        int k = in.readInt();
        int q = in.readInt();
        int[] g = new int[n+1];
        for(int i=1; i<=n; ++i){
            g[i] = in.readInt();
        }
        LinkedList<Integer> linkedList = new LinkedList<>();
        for(int i=0; i<q; ++i){
            int type = in.readInt();
            if(type==1){
                int id = in.readInt();
                if(linkedList.size()<k){
                    int j;
                    for(j=0; j<linkedList.size(); ++j){
                        if(g[id]<linkedList.get(j)){
                            continue;
                        }
                        break;

                    }
                    linkedList.add(j,g[id]);
                }
                else{
                    for(int j=0; j<linkedList.size(); ++j){
                        if(g[id]<linkedList.get(j)){
                            continue;
                        }
                        linkedList.remove(linkedList.size()-1);
                        linkedList.add(j,g[id]);
                        break;
                    }
                }
            }
            else{
                int id = in.readInt();
                boolean flag = false;
                for(int j=0; j<linkedList.size(); ++j){
                    if(g[id]==linkedList.get(j)){
                        flag = true;
                        break;
                    }
                }
                if(flag){
                    out.println("YES");
                }
                else{
                    out.println("NO");
                }
            }

        }

    }

    public static void main(String[] args) throws Exception {
        solve();
        out.close();
    }

    private static class InputReader {
        private InputStream stream;
        private byte[] buffer;
        private int currentIndex;
        private int bytesRead;

        public InputReader(InputStream stream) {
            this.stream = stream;
            buffer = new byte[131072];
        }

        public InputReader(InputStream stream, int bufferSize) {
            this.stream = stream;
            buffer = new byte[bufferSize];
        }

        private StringBuilder readRow() throws Exception{
            int c = read();
            while (!isPrintable(c)) {
                c = read();
            }
            StringBuilder result = new StringBuilder();
            do {
                if(c=='X'){
                    c = read();
                    continue;
                }
                result.appendCodePoint(c);
                c = read();
            } while (isPrintable(c));
            return result;
        }

        private int read() throws IOException {
            if (currentIndex >= bytesRead) {
                currentIndex = 0;
                bytesRead = stream.read(buffer);
                if (bytesRead <= 0) {
                    return -1;
                }
            }
            return buffer[currentIndex++];
        }

        public String readString() throws IOException {
            int c = read();
            while (!isPrintable(c)) {
                c = read();
            }
            StringBuilder result = new StringBuilder();
            do {
                result.appendCodePoint(c);
                c = read();
            } while (isPrintable(c));
            return result.toString();
        }

        public int readInt() throws Exception {
            int c = read();
            int sign = 1;
            while (!isPrintable(c)) {
                c = read();
            }
            if (c == '-') {
                sign = -1;
                c = read();
            }
            int result = 0;
            do {
                if ((c < '0') || (c > '9')) {
                    throw new InputMismatchException();
                }
                result *= 10;
                result += (c - '0');
                c = read();
            } while (isPrintable(c));
            return sign * result;
        }

        public long readLong() throws Exception {
            int c = read();
            int sign = 1;
            while (!isPrintable(c)) {
                c = read();
            }
            if (c == '-') {
                sign = -1;
                c = read();
            }
            long result = 0;
            do {
                if ((c < '0') || (c > '9')) {
                    throw new InputMismatchException();
                }
                result *= 10;
                result += (c - '0');
                c = read();
            } while (isPrintable(c));
            return sign * result;
        }

        public double readDouble() throws Exception {
            int c = read();
            int sign = 1;
            while (!isPrintable(c)) {
                c = read();
            }
            if (c == '-') {
                sign = -1;
                c = read();
            }
            boolean fraction = false;
            double multiplier = 1;
            double result = 0;
            do {
                if ((c == 'e') || (c == 'E')) {
                    return sign * result * Math.pow(10, readInt());
                }
                if ((c < '0') || (c > '9')) {
                    if ((c == '.') && (!fraction)) {
                        fraction = true;
                        c = read();
                        continue;
                    }
                    throw new InputMismatchException();
                }
                if (fraction) {
                    multiplier /= 10;
                    result += (c - '0') * multiplier;
                    c = read();
                } else {
                    result *= 10;
                    result += (c - '0');
                    c = read();
                }
            } while (isPrintable(c));
            return sign * result;
        }

        private boolean isPrintable(int c) {
            return ((c > 32) && (c < 127));
        }
    }

    private static class OutputWriter {
        private PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

        public void flush() {
            writer.flush();
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.*;

public class B {
    public static void main(String[] args) {
//        Scanner sc = new Scanner(System.in);
        FastScanner sc = new FastScanner();

        int n = sc.nextInt();
        int k = sc.nextInt();
        int q = sc.nextInt();
        Friend[] friends = new Friend[n];
        for (int i = 0; i < n; i++) {
            int t = sc.nextInt();
            Friend friend = new Friend(i, t);
            friends[i] = friend;
        }

        PriorityQueue<Friend> pq = new PriorityQueue<>(20);
        boolean[] inPq = new boolean[n];
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < q; i++) {
            int type = sc.nextInt();
            int id = sc.nextInt() - 1;
            if (type == 1) {
                pq.offer(friends[id]);
                inPq[id] = true;
                if (pq.size() > k) {
                    Friend loser = pq.poll();
                    inPq[loser.id] = false;
                }
            } else {
                if (inPq[id]) {
                    sb.append("YES");
                } else {
                    sb.append("NO");
                }
                sb.append('\n');
            }
        }

        System.out.print(sb);
    }

    static class Friend implements Comparable<Friend> {
        final int id;
        final long t;
        public Friend(int id, long t) {
            this.id = id;
            this.t = t;
        }
        public int compareTo(Friend o) {
            int cmp =  Long.compare(t, o.t);
            if (cmp != 0) return cmp;
            return Integer.compare(id, o.id);
        }
    }

    static void shuffle(int[] arr) {
        Random rng = new Random();
        int length = arr.length;
        for (int idx = 0; idx < arr.length; idx++) {
            int toSwap = idx + rng.nextInt(length-idx);
            int tmp = arr[idx];
            arr[idx] = arr[toSwap];
            arr[toSwap] = tmp;
        }
    }

    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }
        public FastScanner() {
            this(new InputStreamReader(System.in));
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String readNextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        int[] readIntArray(int n) {
            int[] a = new int[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextInt();
            }
            return a;
        }
        long[] readLongArray(int n) {
            long[] a = new long[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextLong();
            }
            return a;
        }
    }
}


import java.io.*;
import java.util.*;
import java.lang.*;

public class Boredom {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		Scanner s = new Scanner(System.in);
		int n,k,q;
		n = s.nextInt();
		k = s.nextInt();
		q = s.nextInt();
		HashMap<Integer, Integer> priority = new HashMap<>();
		for(int i=0;i<n;i++)
		{
			int temp = s.nextInt();
			priority.put(i+1, temp);
		}
		HashMap<Integer, Integer> map = new HashMap<>();
		int minpri=Integer.MAX_VALUE,idmin=0;
		for(int j=0;j<q;j++)
		{
			int type,id;
			type = s.nextInt();
			id = s.nextInt();
			if(type==1)
			{
				if(map.size()<k)
				{
					map.put(id, 1);
					if(priority.get(id)<minpri)
					{
						minpri = priority.get(id);
						idmin=id;
					}
				}
				else
				{
					if(minpri<priority.get(id))
					{
						map.remove(idmin);
						map.put(id, 1);
						minpri=Integer.MAX_VALUE;
						for(int u:map.keySet())
						{
							if(priority.get(u)<minpri)
							{
								minpri = priority.get(u);
								idmin = u;
							}
						}
					}
				}

			}
			else
			{
				if(map.containsKey(id))
				{
					System.out.println("YES");
				}
				else
				{
					System.out.println("NO");
				}
			}
		}
	}

}


/**
 * Created by heat_wave on 12.01.15.
 */

import java.io.*;
import java.util.*;

public class A {
    Scanner in = new Scanner(System.in);

    public void solve() {
        int n = in.nextInt();
        int k = in.nextInt();
        int q = in.nextInt();
        HashMap<Integer, Integer> to = new HashMap<>();
        HashMap<Integer, Integer> from = new HashMap<>();

        for (int i = 0; i < n; i++) {
            int val = in.nextInt();
            int id = i + 1;
            to.put(val, id);
            from.put(id, val);
        }
        PriorityQueue<Integer> queue = new PriorityQueue<>(Comparator.reverseOrder());

        for (int i = 0; i < q; i++) {
            int type = in.nextInt();
            int id = in.nextInt();
            if (type == 1) {
                queue.add(from.get(id));
            } else {
                ArrayList<Integer> res = new ArrayList<>();
                boolean flag = false;
                for (int j = 0; j < Math.min(k, queue.size()); j++) {
                    int f = queue.poll();
                    if (to.get(f) == id) {
                        flag = true;
                    }
                    res.add(f);
                }
                queue.addAll(res);

                if (flag) {
                    System.out.println("YES");
                }
                else {
                    System.out.println("NO");
                }
            }
        }
    }

    private class Pair<S, T> {
        public S first;
        public T second;

        public Pair(S first, T second) {
            this.first = first;
            this.second = second;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Pair<?, ?> pair = (Pair<?, ?>) o;

            if (!first.equals(pair.first)) return false;
            return second.equals(pair.second);

        }

        @Override
        public int hashCode() {
            int result = first.hashCode();
            result = 31 * result + second.hashCode();
            return result;
        }
    }

    private static long findGCD(long number1, long number2) {
        //base case
        if(number2 == 0){
            return number1;
        }
        return findGCD(number2, number1 % number2);
    }

    public void run() {
        solve();
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    public static void main(String[] args) {
        new A().run();
    }
}


/**
 * Created by heat_wave on 12.01.15.
 */

import java.io.*;
import java.util.*;

public class A {
    Scanner in = new Scanner(System.in);

    public void solve() {
        int n = in.nextInt();
        int k = in.nextInt();
        int q = in.nextInt();
        HashMap<Integer, Integer> to = new HashMap<>();
        HashMap<Integer, Integer> from = new HashMap<>();

        for (int i = 0; i < n; i++) {
            int val = in.nextInt();
            int id = i + 1;
            to.put(val, id);
            from.put(id, val);
        }
        PriorityQueue<Integer> queue = new PriorityQueue<>(Comparator.reverseOrder());

        for (int i = 0; i < q; i++) {
            int type = in.nextInt();
            int id = in.nextInt();
            if (type == 1) {
                queue.add(from.get(id));
            } else {
                ArrayList<Integer> res = new ArrayList<>();
                boolean flag = false;
                int size = queue.size();
                for (int j = 0; j < Math.min(k, size); j++) {
                    int f = queue.poll();
                    if (from.get(id) == f) {
                        flag = true;
                    }
                    res.add(f);
                }
                queue.addAll(res);

                if (flag) {
                    System.out.println("YES");
                }
                else {
                    System.out.println("NO");
                }
            }
        }
    }

    private class Pair<S, T> {
        public S first;
        public T second;

        public Pair(S first, T second) {
            this.first = first;
            this.second = second;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Pair<?, ?> pair = (Pair<?, ?>) o;

            if (!first.equals(pair.first)) return false;
            return second.equals(pair.second);

        }

        @Override
        public int hashCode() {
            int result = first.hashCode();
            result = 31 * result + second.hashCode();
            return result;
        }
    }

    private static long findGCD(long number1, long number2) {
        //base case
        if(number2 == 0){
            return number1;
        }
        return findGCD(number2, number1 % number2);
    }

    public void run() {
        solve();
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    public static void main(String[] args) {
        new A().run();
    }
}


import java.util.*;
import java.io.*;
import java.math.*;
public final class Solution
{
	static int[] arr;
    public static void main(String[] args)
    {
    	 Reader input = new Reader();
         PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
         int n = input.nextInt(), k = input.nextInt(), q = input.nextInt() , a , b;
         int[] v = new int[n];
         HashMap<Integer,Integer> map = new HashMap<>();
         for(int i = 0 ; i < n ; i++)
         {
        	 v[i] = input.nextInt();
        	 map.put(v[i],i+1);
         }
         boolean[] arr = new boolean[n+1];
         PriorityQueue<Integer> queue = new PriorityQueue<>();
         for(int i = 0 ; i < q ; i++)
         {
        	 a = input.nextInt();
        	 b = input.nextInt();
        	 if(a == 2)
        	 {
        		 if(arr[b])
        			 out.println("YES");
        		 else
        			 out.println("NO");
        	 }
        	 else
        	 {
        		 if(k > 0)
        		 {
        			 k--;
        			 queue.add(v[b-1]);
        			 arr[b] = true;
        		 }
        		 else
        		 {
        			 if(v[b-1] > queue.peek())
        			 {
        				 queue.add(v[b-1]);
        				 arr[b] = true;
        				 arr[map.get(queue.poll())] = false;
        			 }
        		 }
        	 }
         }
		 out.close();
    }
    public static class Reader
    {
    	BufferedReader br;
    	StringTokenizer st;
    	public Reader()
    	{
    		br = new BufferedReader(new InputStreamReader(System.in));
    	}
    	public String next()
    	{
    		try
    		{
        		if(st == null || !st.hasMoreTokens())
        			st = new StringTokenizer(br.readLine());
    		}
    		catch(IOException ex)
    		{
    			ex.printStackTrace();
    			System.exit(1);
    		}
    		return st.nextToken();
    	}
    	public int nextInt()
    	{
    		return Integer.parseInt(next());
    	}
    	public double nextDouble()
    	{
    		return Double.parseDouble(next());
    	}
    	public long nextLong()
    	{
    		return Long.parseLong(next());
    	}
    	public String nextLine()
    	{
    		try
    		{
    			return br.readLine();
    		}
    		catch(IOException ex)
    		{
    			ex.printStackTrace();
    			System.exit(1);
    		}
    		return "";
    	}
    }
}


/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{

		// your code goes here
	Scanner sc=new Scanner(System.in);
		int n,k,q;

		n=sc.nextInt();
		k=sc.nextInt();
		q=sc.nextInt();

		int arr[]=new int[n+1];
		//int k=Math.min(6,n);
		int disp[]=new int[k];
		for(int i=1;i<n+1;i++){
			//arr[i]=new Pair();
			arr[i]=sc.nextInt();
			//arr[i].in=i+1;
		}

		int j=0;

		int counter=1;
		for(int i=0;i<q;i++){

			int c=sc.nextInt();
			if(c==1)
			{
				int en=sc.nextInt();
				if(j<k)
				{

					disp[j]=arr[en];
				     j++;
				}
				else{

				if(counter==1)
	                {
	                	Arrays.sort(disp);
	                    counter=2;
	                }
	                 if(disp[0]<arr[en])
	                 	disp[0]=arr[en];
	                 else
	                 	continue;

				}

			}
			else{
				int en=sc.nextInt(),fl=0;
				for(int l=0;l<k;l++){
					if(disp[l]==arr[en]){
						System.out.println("YES");
						fl=1;
					}

				}
				if(fl==0)
					System.out.println("NO");
			}
		}

	}
}


/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{

		// your code goes here
	Scanner sc=new Scanner(System.in);
		int n,k,q;

		n=sc.nextInt();
		k=sc.nextInt();
		q=sc.nextInt();

		int arr[]=new int[n+1];
		//int k=Math.min(6,n);
		int disp[]=new int[k];
		for(int i=1;i<n+1;i++){
			//arr[i]=new Pair();
			arr[i]=sc.nextInt();
			//arr[i].in=i+1;
		}

		int j=0;

		int counter=1;
		for(int i=0;i<q;i++){

			int c=sc.nextInt();
			if(c==1)
			{
				int en=sc.nextInt();
				if(j<k)
				{

					disp[j]=arr[en];
				     j++;
				}
				else{

				//if(counter==1)

	                	Arrays.sort(disp);
	                //    counter=2;

	                 if(disp[0]<arr[en])
	                 	disp[0]=arr[en];
	                 else
	                 	continue;

				}

			}
			else{
				int en=sc.nextInt(),fl=0;
				for(int l=0;l<k;l++){
					if(disp[l]==arr[en]){
						System.out.println("YES");
						fl=1;
						break;
					}

				}
				if(fl==0)
					System.out.println("NO");
			}
		}

	}
}


//package VKCup;/**
// * Created by ankurverma1994
// */

import java.io.*;
import java.util.*;
import java.math.*;

public class ProbB {
    final int mod = (int) 1e9 + 7;
    final double eps = 1e-6;
    final double pi = Math.PI;

    //------------> Solution starts here!!
    @SuppressWarnings("Main Logic")
    void solve() {
        int n = ii(), k = ii(), q = ii(), t[] = iia(n);
        int a[] = new int[k];
        for (int Q = 0; Q < q; Q++) {
            int type = ii(), id = ii() - 1;
            if (type == 1) {
                int min = Integer.MAX_VALUE, mini = 0;
                for (int i = 0; i < k; i++) {
                    if (a[i] < min) {
                        min = a[i];
                        mini = i;
                    }
                }
                a[mini] = t[id];
            } else {
                boolean online = false;
                for (int i = 0; i < k; i++) {
                    if (a[i] == t[id]) {
                        online = true;
                        break;
                    }
                }
                out.println(online ? "YES" : "NO");
            }
        }
    }

    //------------> Solution ends here!!
    InputStream obj;
    PrintWriter out;
    String check = "";

    public static void main(String[] args) throws IOException {
        new Thread(null, new Runnable() {
            public void run() {
                try {
                    new ProbB().main1();
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (StackOverflowError e) {
                    System.out.println("RTE");
                }
            }
        }, "1", 1 << 26).start();
    }

    void main1() throws IOException {
        out = new PrintWriter(System.out);
        obj = check.isEmpty() ? System.in : new ByteArrayInputStream(check.getBytes());
        // obj=check.isEmpty() ? new FileInputStream("/home/ankurverma1994/input.txt") : new ByteArrayInputStream(check.getBytes());
        solve();
        out.flush();
        out.close();
    }

    byte inbuffer[] = new byte[1024];
    int lenbuffer = 0, ptrbuffer = 0;

    int readByte() {
        if (lenbuffer == -1) throw new InputMismatchException();
        if (ptrbuffer >= lenbuffer) {
            ptrbuffer = 0;
            try {
                lenbuffer = obj.read(inbuffer);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }
        if (lenbuffer <= 0) return -1;
        return inbuffer[ptrbuffer++];
    }

    String is() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) // when nextLine, (isSpaceChar(b) && b!=' ')
        {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    int ii() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    long il() {
        long num = 0;
        int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    boolean isSpaceChar(int c) {
        return (!(c >= 33 && c <= 126));
    }

    int skip() {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
        return b;
    }

    float nf() {
        return Float.parseFloat(is());
    }

    double id() {
        return Double.parseDouble(is());
    }

    char ic() {
        return (char) skip();
    }

    int[] iia(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) a[i] = ii();
        return a;
    }

    long[] ila(int n) {
        long a[] = new long[n];
        for (int i = 0; i < n; i++) a[i] = il();
        return a;
    }

    String[] isa(int n) {
        String a[] = new String[n];
        for (int i = 0; i < n; i++) a[i] = is();
        return a;
    }

    double[][] idm(int n, int m) {
        double a[][] = new double[n][m];
        for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = id();
        return a;
    }

    int[][] iim(int n, int m) {
        int a[][] = new int[n][m];
        for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = ii();
        return a;
    }
}


//package VKCup;/**
// * Created by ankurverma1994
// */

import java.io.*;
import java.util.*;
import java.math.*;

public class ProbB {
    final int mod = (int) 1e9 + 7;
    final double eps = 1e-6;
    final double pi = Math.PI;

    //------------> Solution starts here!!
    @SuppressWarnings("Main Logic")
    void solve() {
        int n = ii(), k = ii(), q = ii(), t[] = iia(n);
        int a[] = new int[k];
        for (int Q = 0; Q < q; Q++) {
            int type = ii(), id = ii() - 1;
            if (type == 1) {
                int min = Integer.MAX_VALUE, mini = 0;
                for (int i = 0; i < k; i++) {
                    if (a[i] < min) {
                        min = a[i];
                        mini = i;
                    }
                }
                if(a[mini]<t[id]) {
                    a[mini] = t[id];
                }
            } else {
                boolean online = false;
                for (int i = 0; i < k; i++) {
                    if (a[i] == t[id]) {
                        online = true;
                        break;
                    }
                }
                out.println(online ? "YES" : "NO");
            }
        }
    }

    //------------> Solution ends here!!
    InputStream obj;
    PrintWriter out;
    String check = "";

    public static void main(String[] args) throws IOException {
        new Thread(null, new Runnable() {
            public void run() {
                try {
                    new ProbB().main1();
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (StackOverflowError e) {
                    System.out.println("RTE");
                }
            }
        }, "1", 1 << 26).start();
    }

    void main1() throws IOException {
        out = new PrintWriter(System.out);
        obj = check.isEmpty() ? System.in : new ByteArrayInputStream(check.getBytes());
        // obj=check.isEmpty() ? new FileInputStream("/home/ankurverma1994/input.txt") : new ByteArrayInputStream(check.getBytes());
        solve();
        out.flush();
        out.close();
    }

    byte inbuffer[] = new byte[1024];
    int lenbuffer = 0, ptrbuffer = 0;

    int readByte() {
        if (lenbuffer == -1) throw new InputMismatchException();
        if (ptrbuffer >= lenbuffer) {
            ptrbuffer = 0;
            try {
                lenbuffer = obj.read(inbuffer);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }
        if (lenbuffer <= 0) return -1;
        return inbuffer[ptrbuffer++];
    }

    String is() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) // when nextLine, (isSpaceChar(b) && b!=' ')
        {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    int ii() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    long il() {
        long num = 0;
        int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    boolean isSpaceChar(int c) {
        return (!(c >= 33 && c <= 126));
    }

    int skip() {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
        return b;
    }

    float nf() {
        return Float.parseFloat(is());
    }

    double id() {
        return Double.parseDouble(is());
    }

    char ic() {
        return (char) skip();
    }

    int[] iia(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) a[i] = ii();
        return a;
    }

    long[] ila(int n) {
        long a[] = new long[n];
        for (int i = 0; i < n; i++) a[i] = il();
        return a;
    }

    String[] isa(int n) {
        String a[] = new String[n];
        for (int i = 0; i < n; i++) a[i] = is();
        return a;
    }

    double[][] idm(int n, int m) {
        double a[][] = new double[n][m];
        for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = id();
        return a;
    }

    int[][] iim(int n, int m) {
        int a[][] = new int[n][m];
        for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = ii();
        return a;
    }
}


import java.util.*;
import java.io.*;
public class B {
	public static void main(String...donthackmeplease) throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int k = Integer.parseInt(st.nextToken());
		int q = Integer.parseInt(st.nextToken());
		int[] t = new int[n+1]; int[] _t = new int[150001];
		st = new StringTokenizer(br.readLine());
		for(int i = 1; i <= n; i++){
			t[i] = Integer.parseInt(st.nextToken());
			_t[t[i]] = i;
		}
		TreeSet<Integer> set = new TreeSet<>();
		boolean[] in = new boolean[n+1];
		for(int i = 0; i < q; i++){
			st = new StringTokenizer(br.readLine());
			int ty = Integer.parseInt(st.nextToken());
			int id = Integer.parseInt(st.nextToken());
			if(ty == 1){
				set.add(t[id]); in[id] = true;
				if(set.size() > k){
					int x = set.pollFirst();
					in[_t[x]] = false;
				}
			}
			else{
				System.out.println(in[id]? "YES":"NO");
			}
		}
	}
}


import java.util.*;
import java.io.*;
public class B {
	public static void main(String...donthackmeplease) throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int k = Integer.parseInt(st.nextToken());
		int q = Integer.parseInt(st.nextToken());
		int[] t = new int[n];
		st = new StringTokenizer(br.readLine());
		for(int i = 0; i < n; i++){
			t[i] = Integer.parseInt(st.nextToken());
		}
		TreeMap<Integer, Integer> map = new TreeMap<>();
		boolean[] in = new boolean[n];
		for(int i = 0; i < q; i++){
			st = new StringTokenizer(br.readLine());
			int ty = Integer.parseInt(st.nextToken());
			int id = Integer.parseInt(st.nextToken())-1;
			if(ty == 1){
				map.put(t[id],id); in[id] = true;
				if(map.size() > k){
					int f = map.firstKey();
					int l = map.remove(f);
					in[l] = false;
				}
			}
			else{
				System.out.println(in[id]? "YES":"NO");
			}
		}
	}
}


import java.util.*;
public class BearAndDisplayedFriends
{
	static ArrayList<Integer> list;
	public static void main(String[] args)
	{
		Scanner input = new Scanner(System.in);
		list = new ArrayList<Integer>();
		int n = input.nextInt();
		int k = input.nextInt();
		int q = input.nextInt();
		int[] friends = new int[n];
		for (int i = 0; i < n; i++)
		{
			friends[i] = input.nextInt();
		}
		for (int j = 0; j < q; j++)
		{
			if (input.nextInt() == 1)
			{
				addEle(friends[input.nextInt()-1]);
			}
			else
			{
				int index = input.nextInt();
				int val = friends[index-1];
				int place = Collections.binarySearch(list, val);
				if (place < list.size() - k || place < 0)
				{
					System.out.println("NO");
				}
				else
				{
					System.out.println("YES");
				}
			}
		}
	}

	static void addEle(int n)
	{
		if (list.isEmpty())
		{
			list.add(n);
		}
		else
		{
			list.add(binarySearchAdd(0, list.size(), n), n);
		}
	}

	static int binarySearchAdd(int low, int high, int key)
	{
		if (low == high)
		{
			return low;
		}
		int mid = low + (high-low)/2;
		if (mid == low)
		{
			if (list.get(mid) < key)
			{
				return high;
			}
			return mid;
		}
		if (list.get(mid) == key)
		{
			return mid;
		}
		if (list.get(mid) < key)
		{
			return binarySearchAdd(mid, high, key);
		}
		return binarySearchAdd(low, mid, key);
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class BearandDisplayedFriends {
    public static void main(String asd[])throws Exception
    {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int k=in.nextInt();
        int q=in.nextInt();
        long a[]=new long[n];
        int b[]=new int[n];
        Arrays.fill(b,0);
        int c[]=new int[k];
        Arrays.fill(c,0);int m=0;
        for(int i=0;i<n;i++)
            a[i]=in.nextInt();
        for(int i=0;i<q;i++)
        {
            int w=in.nextInt();
            int e=in.nextInt()-1;
            if(w==1)
            {
                if(m!=k)
                {
                    c[m]=e;
                    b[e]=1;
                    m++;
                }
                else{
                    long min=Long.MAX_VALUE;int j=-1;
                    for(int mm=0;mm<k;mm++)
                        if(a[c[mm]]<min)
                        {
                            min=a[c[mm]];
                            j=mm;
                        }
                    if(j>=0 && a[e]>a[c[j]])
                    {
                        b[c[j]]=0;
                        c[j]=e;
                        b[e]=1;
                        //break;
                    }
                }
            }
            else if (w==2)
            {
                if(b[e]==1)
                    System.out.println("YES");
                else
                    System.out.println("NO");
            }
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class BearandDisplayedFriends {
    public static void main(String asd[])throws Exception
    {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int k=in.nextInt();
        int q=in.nextInt();
        int a[]=new int[n];
        int b[]=new int[n];
        Arrays.fill(b,0);
        int c[]=new int[k];
        Arrays.fill(c,0);int m=0;
        for(int i=0;i<n;i++)
            a[i]=in.nextInt();
        for(int i=0;i<q;i++)
        {
            int w=in.nextInt();
            int e=in.nextInt()-1;
            if(w==1)
            {
                if(m!=k)
                {
                    c[m]=e;
                    b[e]=1;
                    m++;
                }
                else{
                    int min=Integer.MAX_VALUE;int j=-1;
                    for(int mm=0;mm<k;mm++)
                        if(a[c[mm]]<min)
                        {
                            min=a[c[mm]];
                            j=mm;
                        }
                    if(j>=0)
                    {
                        b[c[j]]=0;
                        c[j]=e;
                        b[e]=1;
                        //break;
                    }
                }
            }
            else if (w==2)
            {
                if(b[e]==1)
                    System.out.println("YES");
                else
                    System.out.println("NO");
            }
        }
    }
}


import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

public class B {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int k = in.nextInt();
		int q = in.nextInt();
		int[][] t = new int[n][2];
		for (int i = 0; i < n; i++) {
			t[i][0] = i+1;
			t[i][1] = in.nextInt();
		}
		PriorityQueue<Integer[]> queue = new PriorityQueue<Integer[]>(new Comparator<Integer[]>() {
			@Override
			public int compare(Integer[] o1, Integer[] o2) {
				if (o1[1] < o2[1])
					return -1;
				else
					return 1;
			}

		});
		for (int i = 0; i < q; i++) {
			int querry = in.nextInt();
			int id = in.nextInt();
			if (querry == 1) {
				if (queue.size() < k) {
					Integer[] temp = new Integer[2];
					temp[0] = id;
					temp[1] = t[id-1][1];
					queue.add(temp);
				} else {
					if (queue.peek()[1] < t[id-1][1]) {
						Integer[] temp = new Integer[2];
						temp[0] = id;
						temp[1] = t[id-1][1];
						queue.add(temp);
						queue.poll();
					}
				}
			} else {
				boolean found = false;
				for (Integer[] temp: queue)
					if (temp[0] == id)
						found = true;
				System.out.println(found?"YES":"NO");
			}
		}
	}
}


// @author:debverine | 28-Mar-2016 | 11:37:03 pm
import java.io.*;
import java.util.*;

public class Bear_Displayed_Friends {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		int n,k,q,ch,id,i;
		long arr[];
		String inp[],inpa[];
		boolean flag;
		inp=br.readLine().split(" ");
		n=Integer.parseInt(inp[0]);
		k=Integer.parseInt(inp[1]);
		q=Integer.parseInt(inp[2]);
		arr=new long[n];
		inpa=br.readLine().split(" ");
		Arrays.fill(arr, -1);
		while ( q-- > 0 ) {
			inp=br.readLine().split(" ");
			ch=Integer.parseInt(inp[0]);
			id=Integer.parseInt(inp[1]);
			if(ch==1){
				arr[0]=Integer.parseInt(inpa[id-1]);
				Arrays.sort(arr);
			}
			else{
				id=Integer.parseInt(inpa[id-1]);
				flag = false;
				for(i=n-1;i>=n-k;i--){
					if(arr[i]==id)
						flag=true;
				}
				if(flag)
					pw.println("YES");
				else
					pw.println("NO");
			}
		}
		pw.flush();
		pw.close();

	}

}


// @author:debverine | 28-Mar-2016 | 11:37:03 pm
import java.io.*;
import java.util.*;

public class Bear_Displayed_Friends {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		int n,k,q,ch,id,i;
		long arr[];
		String inp[],inpa[];
		boolean flag;
		inp=br.readLine().split(" ");
		n=Integer.parseInt(inp[0]);
		k=Integer.parseInt(inp[1]);
		q=Integer.parseInt(inp[2]);
		arr=new long[k];
		inpa=br.readLine().split(" ");
		Arrays.fill(arr, -1);
		while ( q-- > 0 ) {
			inp=br.readLine().split(" ");
			ch=Integer.parseInt(inp[0]);
			id=Integer.parseInt(inp[1]);
			if(ch==1){
				if(arr[0]<Integer.parseInt(inpa[id-1]))
					arr[0]=Integer.parseInt(inpa[id-1]);
				Arrays.sort(arr);
			}
			else{
				id=Integer.parseInt(inpa[id-1]);
				flag = false;
				for(i=0;i<k;i++){
					if(arr[i]==id)
						flag=true;
				}
				if(flag)
					pw.println("YES");
				else
					pw.println("NO");
			}
		}
		pw.flush();
		pw.close();

	}

}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class BearAndDisplayedFriends {
    static int[] deskId;
    static int[] deskValue;

    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        StringBuilder sb = new StringBuilder();
        String[] inputData = br.readLine().split(" ");
        String[] inputData2 = br.readLine().split(" ");
        int n = Integer.parseInt(inputData[0]), k = Math.min(6, Integer.parseInt(inputData[1])), q = Integer.parseInt(inputData[2]);
        int[] t = new int[n];
        int[] onDesk = new int[n];
        deskId = new int[k];
        deskValue = new int[k];
        int type, id, i, l = 0;
        for (i = 0; i < n; i++) {
            t[i] = Integer.parseInt(inputData2[i]);
            onDesk[i] = 0;
        }
        for (i = 0; i < q; i++) {
            inputData = br.readLine().split(" ");
            type = Integer.parseInt(inputData[0]);
            id = Integer.parseInt(inputData[1]) - 1;
            if (type == 1) {
                if (l < k) {
                    onDesk[id] = 1;
                    deskId[l] = id;
                    deskValue[l] = t[id];
                    l++;
                }
                else {
                    int temp = t[id];
                    quickSort(deskValue, 0, k - 1);
                    if (temp > deskValue[0]) {
                        onDesk[id] = 1;
                        onDesk[deskId[0]] = 0;
                        deskValue[0] = temp;
                        deskId[0] = id;
                    }
                }
            }
            else {
                if (onDesk[id] == 1)
                    sb.append("YES\n");
                else
                    sb.append("NO\n");
            }
        }
        pw.println(sb.toString());
        pw.close();
    }

    static int partition(int arr[], int left, int right) {
        int i = left, j = right;
        int tmp;
        int pivot = arr[(left + right) / 2];
        while (i <= j) {
            while (arr[i] < pivot)
                i++;
            while (arr[j] > pivot)
                j--;
            if (i <= j) {
                tmp = arr[i];
                arr[i] = arr[j];
                arr[j] = tmp;
                tmp = deskId[i];
                deskId[i] = deskId[j];
                deskId[j] = tmp;
                i++;
                j--;
            }
        }
        return i;
    }

    static void quickSort(int arr[], int left, int right) {
        int index = partition(arr, left, right);
        if (left < index - 1)
            quickSort(arr, left, index - 1);
        if (index < right)
            quickSort(arr, index, right);
    }
}


import java.io.*;
import java.math.*;
import java.util.*;
/**
 * @author ramilagger
 *
 */
public class Main {

    final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

    public void solve() throws Exception {
        int n = nextInt();
        int k = nextInt();
        int q = nextInt();
        int[] win = new int[k];
        int rating[] = new int[k];
        int[] id = new int[n + 1];
        Arrays.fill(win,-1);
        Arrays.fill(rating,-1);

        for (int i = 1; i < n + 1; i++) {
            id[i] = nextInt();
        }

        int t, r,min,in;
        outer: for (int i = 0; i < q; i++) {

            t = nextInt();
            r = nextInt();
            if(t == 2){

                for (int j = 0; j < k; j++) {
                    if (win[j] == r) {
                        pw.println("YES");
                        continue outer;
                    }
                }

                pw.println("NO");
            }

            if (t == 1) {

                for (int j = 0; j < k; j++) {
                    if (win[j] == -1) {
                        rating[j] = id[r];
                        win[j] = r;
                        continue outer;
                    }
                }

                min = Integer.MAX_VALUE;
                in = -1;
                for (int j = 0; j < k; j++) {
                    if (rating[j] < min) {
                        min = rating[j];
                        in = j;
                    }
                }
                if(rating[in] < id[r]){
                        win[in] = r;
                        rating[in] = id[r];
                    }
                }
            }
    }

    public void run() throws Exception{
        long start = System.currentTimeMillis();
        solve();
        if(!ONLINE_JUDGE){
            long end = System.currentTimeMillis();
            System.err.println(end - start + " ms");
        }
        pw.close();
    }

    public Main() throws Exception {

        br = (ONLINE_JUDGE) ? new BufferedReader(new InputStreamReader(System.in))
                : new BufferedReader(new FileReader("in.txt"));

        pw = (ONLINE_JUDGE) ?
                new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)))
                : new PrintWriter(new BufferedWriter(new FileWriter("out.txt")));

    }

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    public String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    public double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public BigInteger nextBigInteger () throws IOException {
        return new BigInteger(next());
    }

    public String nextLine() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            return br.readLine();
        }
        StringBuilder sb = new StringBuilder(st.nextToken());
        while (st.hasMoreTokens()){
            sb.append(" " + st.nextToken());
        }
        return sb.toString();
    }

    public int[] nextArray(int n) throws IOException {
        int[] temp = new int[n];
        for (int i = 0; i < n; i++) {
            temp[i] = nextInt();
        }
        return temp;
    }

    public long[] nextLArray(int n) throws IOException {
        long[] temp = new long[n];
        for (int i = 0; i < n; i++) {
            temp[i] = nextLong();
        }
        return temp;
    }

    final BufferedReader br;
    final PrintWriter pw;
    StringTokenizer st;

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.HashMap;

public class NewClass1 {
    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        int[] A = iarray(in.readLine(), 3);
        int n = A[0];
        int k = A[1];
        int q = A[2];
        HashMap<Integer, Integer> map = new HashMap<>();
        int[] t = iarray(in.readLine(), n);
        int[] type = new int[q];
        int[] id = new int[q];
        for (int i=1; i<=n; i++) {
            map.put(i, 0);
        }
        ArrayList<Integer> list = new ArrayList<>();
        for (int i=0; i<q; i++) {
            int[] B = iarray(in.readLine(), 2);
            type[i] = B[0];
            id[i] = B[1];
            if (B[0]==1) {
                if (list.size()<k) {
                    map.put(B[1], 1);
                    list.add(B[1]);
                }
                else {
                    int min = t[list.get(0)-1];
                    int index=0;
                    for (int j=0; j<k; j++) {
                        if (t[list.get(j)-1]<min) {
                            min = t[list.get(j)-1];
                            index=j;
                        }
                    }
                    if (t[B[1]-1]>min) {
                        map.put(list.get(index), 0);
                        list.remove(index);
                        list.add(B[1]);
                        map.put(B[1], 1);
                    }
                }
            }
            else {
                if (map.get(B[1])==1) {
                    out.write("YES\n");
                }
                else {
                    out.write("NO\n");
                }
            }
        }
        out.flush();
    }

    private static int iparse (String s) {
        int n = Integer.parseInt(s);
        return n;
    }

    private static long lparse (String s) {
        long n = Long.parseLong(s);
        return n;
    }

    private static double dparse (String s) {
        double n = Double.parseDouble(s);
        return n;
    }

    private static int[] iarray (String s, int n) {
        String[] s1 = s.split(" ");
        int[] A = new int[n];
        for (int i=0; i<n; i++) {
            A[i] = Integer.parseInt(s1[i]);
        }
        return A;
    }

    private static long[] larray (String s, int n) {
        String[] s1 = s.split(" ");
        long[] A = new long[n];
        for (int i=0; i<n; i++) {
            A[i] = Long.parseLong(s1[i]);
        }
        return A;
    }

    private static double[] darray (String s, int n) {
        String[] s1 = s.split(" ");
        double[] A = new double[n];
        for (int i=0; i<n; i++) {
            A[i] = Double.parseDouble(s1[i]);
        }
        return A;
    }
}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;

public class Main {

    static int mod = 1000000007;

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new PrintWriter(System.out));

        String[] in = br.readLine().split(" ");

        int n = Integer.parseInt(in[0]);
        int k = Integer.parseInt(in[1]);
        int q = Integer.parseInt(in[2]);
        in=br.readLine().split(" ");
        int[] t = new int[n];
        for(int i=0;i<n;i++)    t[i] = Integer.parseInt(in[i]);
        int[] v = new int[n];
        ArrayList<Integer> C = new ArrayList<>(k);
        for(int i=0;i<q;i++){
            in = br.readLine().split(" ");
            int ty = Integer.parseInt(in[0]);
            int id= Integer.parseInt(in[1]);
            id-=1;

            if(ty==1){
                if(C.size() < k){
                    C.add(id);
                    v[id] = 1;
                }else{
                    Collections.sort(C, new Comparator<Integer>(){
                        @Override
                        public int compare(Integer x, Integer y) {
                            return t[x]-t[y];
                        }
                    });
                    int it = -1;
                    for(Integer item : C){
                        if(t[id] > t[item]){
                            it = item;
                            break;
                        }
                    }

                    if(it != -1){
                        C.remove((Integer)it);
                        v[it] = 0;
                        v[id] = 1;
                        C.add(id);
                    }
                }
            }
            else{
                if(v[id] == 0)  bw.append("NO\n");
                else    bw.append("YES\n");
            }
        }

        bw.close();

    }

}


import java.util.Scanner;

public class Main {

    private static int[] friends;
    private static int[] window;

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        int k = in.nextInt();
        int q = in.nextInt();

        friends = new int[n];
        for(int i = 0; i < n; i++)
            friends[i] = in.nextInt();

        window = new int[k];
        for(int i = 0; i < k; i++)
            window[i] = 0;

        for(int i = 0; i < q; i++)
            if(in.nextInt() == 1)
                online(in.nextInt());
            else
                check(in.nextInt());

    }

    private static void online(int id) {
        int p = friends[id - 1];
        int j = -1;

        for(int i = 0; i < window.length; i++)
            if(window[i] == 0) {
                window[i] = id;
                return;
            } else {
                if(friends[window[i] - 1] < p) {
                    p = friends[window[i] - 1];
                    j = i;
                }
            }

        if(j != -1)
            window[j] = id;

    }

    private static void check(int id) {
        for(int i = 0; i < window.length; i++)
            if(window[i] == id) {
                System.out.println("YES");
                return;
            }

        System.out.println("NO");
    }

}


import java.util.PriorityQueue;
import java.util.Scanner;

/**
 * Mar 28, 2016 | 6:29:31 PM
 *

 * Description
 *
 *

 *
 * @author Essiennta Emmanuel (colourfulemmanuel@gmail.com)
 */
public class ProblemB{

    public void solve(int[] t, int[] type, int[] id, int k){
        PriorityQueue<Integer> pq = new PriorityQueue<>((a, b) -> t[a - 1] - t[b - 1]);
        for (int i = 0; i < type.length; i++)
            if (type[i] == 1)
                if (pq.size() < k)
//                    pq.add(t[id[i] - 1]);
                    pq.add(id[i]);
                else {
                    int min = pq.peek();
                    if (t[min - 1] < t[id[i] - 1]) {
                        pq.remove();
                        pq.add(id[i]);
                    }
                }
            else
                System.out.println(pq.contains(id[i]) ? "YES" : "NO");
    }

    public static void main(String[] args){
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int k = sc.nextInt();
            int q = sc.nextInt();
            int[] t = new int[n];
            for (int i = 0; i < n; i++)
                t[i] = sc.nextInt();
            int[] type = new int[q];
            int[] id = new int[q];
            for (int i = 0; i < q; i++){
                type[i] = sc.nextInt();
                id[i] = sc.nextInt();
            }
            new ProblemB().solve(t, type, id, k);
        }
    }
}