#include <bits/stdc++.h>
using namespace std;
#define nl '\n'
#define ll long long 

void fastio() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
}
vector<bool>visited;
vector<vector<int>>adj;

bool cyclic = false;
void dfs(int node,int p){
    visited[node]=true;

    for(auto child : adj[node]){
        if(child == p)
            continue;

        if(!visited[child]){
            dfs(child,node);
        }
        else{
            cyclic =true;
        }
    }
}
void solve() {
    int n,e;cin >> n>> e;
    int u,v;
    adj.assign(n+1,{});
    visited.assign(n+1,false);
    for(int i=0;i<e;i++){
        cin >> u >> v;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }


    for(int i=1;i<=n;i++){
        if(!visited[i]){
            dfs(i,i);
        }
        
    }
    if(cyclic) cout <<"There is a cycle\n";
    else cout <<"There is not a cycle\n";

}

int main() {
    fastio();
    int t=1;
    //cin >> t;
    while (t--) 
        solve();
    return 0;
}
