#include <bits/stdc++.h>
using namespace std;
long long n, m;
long long flag, cb;
bool ma[1009][1009];
long long in[1009];
vector<long long> c[1009];
bool vis[1009];
void dfs(long long u, long long f) {
  vis[u] = 1;
  for (long long i = 0; i < c[u].size(); i++)
    if (u != c[u][i] && f != c[u][i] && vis[c[u][i]] == 0) {
      dfs(c[u][i], u);
    }
}
signed main() {
  scanf("%lld%lld", &n, &m);
  long long a = 0, b = 0;
  for (long long i = 1; i <= m; i++) {
    scanf("%lld%lld", &a, &b);
    c[a].push_back(b);
    if (ma[a][b] == 1) {
      cb = 1;
    }
    ma[a][b] = ma[b][a] = 1;
    c[b].push_back(a);
  }
  dfs(1, -1);
  for (long long i = 1; i <= n; i++) {
    if (vis[i] == 0) {
      flag = 1;
      break;
    }
  }
  if (flag == 0) {
    if (cb == 0) {
      if (m == n - 1) {
        printf("yes\n");
      } else {
        printf("no\n");
      }
    } else {
      printf("no\n");
    }
  } else {
    printf("no\n");
  }
  return 0;
}
