#include <bits/stdc++.h>

using namespace std;

int main(){
    int n,k; cin>>n>>k;
    int pr;
    bool is=false;
    for(int i=0;i<n;i++){
        int pom; cin>>pom;
        if(i==0) pr=pom;
        if(is==true){
            cout<<pom;
            is=false;
        }
        if(pom==k) is=true;
    }
    if(is==true) cout<<pr;
    return 0;
}