using System;
using System.Collections.Generic;
namespace ConsoleApplication11
{
class Program
{
public static List<int>[] g ;
public static int[] used;
public static int color = 0;
public static void dfs(int v)
{
used[v] = color;
foreach (int to in g[v])
{
if (used[to] == 0 )
{
dfs(to);
}
}
}
static void Main(string[] args)
{
int n, m;
string[] s = Console.ReadLine().Split();
n = int.Parse(s[0]);
m = int.Parse(s[1]);
g = new List<int>[n];
used = new int[m];
for (int i = 0; i < n; i++)
g[i] = new List<int>();
{
}
for (int i = 0; i < m; i++)
{
s = Console.ReadLine().Split();
int from=int.Parse(s[0]);
int to = int.Parse(s[1]);
from--;
to--;
g[from].Add(to);
g[to].Add(from);
}
for (int i = 0; i < n; i++)
{
if (used[n]==0)
{
color++;
dfs(i);
}
}
Console.WriteLine(color == 1? "yes" : "no" );
}
//static void dfs(int v)
//{
// used[v] = 1;
// for (int i = 1; i <= n; i++)
// if (g[v,i] && !used[i]) dfs(i);
//}
}
}