/*
Jackson Simoneau
SI@UCF 2026 - Intro to Competitive Programming

Solution to https://open.kattis.com/problems/birthday
*/

#include <bits/stdc++.h>
using namespace std;

//Recursive DFS to find all nodes connected to the starting node
void dfs(int u, pair<int, int> invalid, vector<bool> &seen, vector<vector<int>> &adj) {
    //Mark node u as visited
    seen[u] = true;
    //Loop over all nodes connected to node u
    for(int v : adj[u]) {
        //Skip the node if it has already been visited
        if(seen[v]) continue;
        //If the edge from u to v is the removed one, we can't take it
        if((u == invalid.first && v == invalid.second) || (v == invalid.first && u == invalid.second)) continue;
        //Recurse to node v and continue exploring the graph
        dfs(v, invalid, seen, adj);
    }
}

int main() {
    int n, m;
    cin >> n >> m;
    //Process test cases
    while(n != 0 && m != 0) {
        vector<vector<int>> adj(n);
        //List of all edges in the graph
        vector<pair<int, int>> edges(m);
        for(int i = 0; i < m; i++) {
            int a, b;
            cin >> a >> b;
            adj[a].push_back(b);
            adj[b].push_back(a);
            //Add this edge to the list of edges
            edges[i] = {a, b};
        }

        //Try removing each edge and see if any of them disconnect the graph
        bool valid = true;
        for(int i = 0; i < m; i++) {
            //Run a DFS starting from any arbitrary vertex (like node 0)
            vector<bool> seen(n, false);
            dfs(0, edges[i], seen, adj);

            //If any nodes were not visited by the DFS, the graph is now disconnected
            for(int j = 0; j < n; j++) {
                if(!seen[j]) {
                    valid = false;
                }
            }
        }

        if(valid) cout << "No\n";
        else cout << "Yes\n";

        //Read variables for next test case
        cin >> n >> m;
    }
}