#include <bits/stdc++.h>
using namespace std;
int checker() {}
int main() {
  int n, m, a[1001], b[1001];
  vector<int> c;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a[i] >> b[i];
  }
  c.push_back(a[1]);
  c.push_back(b[1]);
  a[1] = 0;
  b[1] = 0;
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= m; j++) {
      if (find(c.begin(), c.end(), a[j]) != c.end()) {
        c.push_back(b[j]);
        a[j] = 0;
        b[j] = 0;
      } else if (find(c.begin(), c.end(), b[j]) != c.end()) {
        c.push_back(a[j]);
        a[j] = 0;
        b[j] = 0;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (c[i] == c[j] && i != j) {
        cout << "no" << endl;
        return 0;
      }
    }
  }
  if (c.size() == n)
    cout << "yes";
  else
    cout << "no";
}
