code:
#include
#include
using namespace std;
map<int,int> mp;
int main(){
int n,x,y,z;
cin>>n;
for(int i=1;i<=n;i++){
cin>>z;
if(z==1){
cin>>x>>y;
mp+=y;
}
if(z==2){
cin>>x;
if(mp.count(x)){
cout<<“YES”<<endl;
}else{
cout<<“NO”<<endl;
}
}
}
for(auto it:mp){
cout<< it.first <<" "<< it.second << endl;
}
return 0;
}