#include <bits/stdc++.h>
using namespace std;
vector<int> v[1005];
int vis[1005];
int ads[1005];
void clean() {
  for (int i = 0; i < 1005; i++) {
    v[i].clear();
    vis[i] = -1;
    ads[i] = i;
  }
}
int power(int k, int n) {
  int prod = 1;
  while (n) {
    if (n % 2) prod = (prod % 1000000007 * k % 1000000007) % 1000000007;
    k = (k * k) % 1000000007;
    n /= 2;
  }
  return prod;
}
void dfs(int second) {
  vis[second] = 0;
  for (int j = 0; j < v[second].size(); j++) {
    if (vis[v[second][j]] == -1) dfs(v[second][j]);
  }
}
int root(int a) {
  while (ads[a] != a) {
    ads[a] = ads[ads[a]];
    a = ads[a];
  }
  return a;
}
void unio(int a, int b) {
  int x = root(a);
  int y = root(b);
  ads[x] = ads[y];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  clean();
  long long int n;
  cin >> n;
  ;
  long long int m;
  cin >> m;
  ;
  int jack = 0;
  while (m--) {
    int a, b;
    cin >> a >> b;
    if (root(a) != root(b))
      unio(a, b);
    else
      jack = -1;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  if (jack) {
    cout << "no" << endl;
    return 0;
  } else {
    dfs(1);
    for (int i = 1; i <= n; i++) {
      if (vis[i] == -1) {
        cout << "no" << endl;
        return 0;
      }
    }
    cout << "yes" << endl;
  }
}
