#include<iostream>
#include<vector>
#include<queue>
using namespace std;
vector<int>a[200010];
int n,m,s,t,vis[200010];
string bfs(int x){
queue<int>q;
q.push(x);
vis[x]=1;
while(q.size()){
int top=q.front();
q.pop();
if(top==t) return "Yes";
for(auto i:a[top]){
if(vis[i]) continue;
q.push(i);
vis[i]=1;
}
}
return "No";
}
int main(){
cin>>n>>m>>s>>t;
for(int i=1;i<=m;i++){
int x,y;
cin>>x>>y;
a[x].push_back(y);
}
cout<<bfs(s);
return 0;
}