#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
set<pair<int, int> > S;
int pre[1001];
int Find(int x) {
  if (x == pre[x]) return x;
  return pre[x] = Find(pre[x]);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  if (m != n - 1) {
    cout << "no" << endl;
    return 0;
  }
  for (int i = (1); i < (n + 1); ++i) pre[i] = i;
  for (int i = (0); i < (m); ++i) {
    int x, y;
    cin >> x >> y;
    x = Find(x), y = Find(y);
    if (x == y) {
      cout << "no" << endl;
      return 0;
    }
    pre[x] = y;
  }
  cout << "yes" << endl;
}
