#include<bits/stdc++.h>
using namespace std;
int n,k[220],a,b,vis[220];
struct node{
int y,step;
};
int flag;
void bfs(){
queue<node> q;
q.push({a,0});
vis[a]=1;
while(!q.empty()){
}
int main(){
freopen("bear.in","r",stdin);
freopen("bear.out","w",stdout);
cin>>n>>a>>b;
for(int i=1;i<=n;i++)
cin>>k[i];
bfs();
if(flag==0) cout<<-1;
fclose(stdin);
fclose(stdout);
return 0;
}