#include using namespace std; int main() { int N; cin >> N; int M; cin >> M; if( M >= 5 ){ cout << "Yes\n"; return 0; } int count[N]{}; for( int m = 0 ; m < M ; m++ ){ int i; cin >> i; int j; cin >> j; count[i]++; count[j]++; } set vertex_exception{}; for( int i = 0 ; i < 3 ; i++ ){ int v; cin >> v; vertex_exception.insert( v ); } set vertex{}; for( int i = 0 ; i < N ; i++ ){ if( count[i] >= 2 ){ vertex.insert( i ); } } cout << ( vertex.size() >= 3 && vertex != vertex_exception ? "Yes\n" : "No\n" ); return 0; }