#include <bits/stdc++.h>
using namespace std;
const long long linf = 1e18 + 5;
int mod = (int)1e9 + 7;
const int logN = 18;
const int inf = 1e9 + 9;
const int N = 2003;
int n, m, x, y, z, h[N];
vector<int> v[N];
int dfs(int node, int t) {
  h[node] = 1;
  int ans = 1;
  for (__typeof(v[node].begin()) it = v[node].begin(); it != v[node].end();
       it++)
    if (!h[*it] && *it != t) ans += dfs(*it, t);
  return ans;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  if (dfs(1, 0) == n && m == n - 1) {
    cout << "yes\n";
  } else
    cout << "no\n";
  return 0;
}
