#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long exponentiation(long long base, long long power) {
  long long ans = 1;
  while (power > 0) {
    if (power % 2 == 1) ans = (ans * base) % mod;
    base = (base * base) % mod;
    power /= 2;
  }
  return ans % mod;
}
inline int read_int() {
  bool minus = false;
  int result = 0;
  char ch;
  ch = getchar();
  while (true) {
    if (ch == '-') break;
    if (ch >= '0' && ch <= '9') break;
    ch = getchar();
  }
  if (ch == '-')
    minus = true;
  else
    result = ch - '0';
  while (true) {
    ch = getchar();
    if (ch < '0' || ch > '9') break;
    result = result * 10 + (ch - '0');
  }
  if (minus)
    return (-result);
  else
    return result;
}
vector<int> vecto[100100];
bool visit[100100];
void dfs(int start_point) {
  visit[start_point] = true;
  for (int i = 0; i < vecto[start_point].size(); i++)
    if (!visit[vecto[start_point][i]]) dfs(vecto[start_point][i]);
}
int main() {
  int x, y, naksh, palak;
  for (int i = 0; i < 100100; i++) {
    vecto[i].clear();
    visit[i] = false;
  }
  int n, m, count = 0, per;
  n = read_int();
  m = read_int();
  per = m;
  while (per--) {
    naksh = read_int();
    palak = read_int();
    vecto[naksh].push_back(palak);
    vecto[palak].push_back(naksh);
  }
  if (m != (n - 1))
    printf("no\n");
  else {
    for (int i = 1; i <= n; i++)
      if (!visit[i]) {
        dfs(i);
        count++;
      }
    if (count == 1)
      printf("yes\n");
    else
      printf("no\n");
  }
  return 0;
}
