#include <bits/stdc++.h>
const long long int mod = 9999999999999983;
long long int primes[6] = {1125899906842597, 1495921043, 1005985879,
                           1495921043,       1005985879, 1495921043};
using namespace std;
vector<long long int> adj[2000009];
long long int parent[2000009];
long long int vis[2000009];
long long int level[2000009];
long long int dist[2000009];
long long int arr[2000009];
long long int brr[2000009];
long long int hashing[2000009];
void dfs(long long int val) {
  long long int i;
  vis[val] = 1;
  for (i = 0; i < adj[val].size(); i++) {
    if (vis[adj[val][i]] == 0) {
      dfs(adj[val][i]);
    }
  }
}
int main() {
  int start_s = clock();
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  vector<long long int> vect;
  vector<long long int>::iterator itt;
  set<long long int> st;
  set<long long int>::iterator itr;
  map<long long int, long long int> mp;
  map<long long int, long long int>::iterator it;
  string str;
  long long int i, j, k, n, m, q, t, a, b, c,
      maxi = INT_MIN, mini = INT_MAX, sum = 0, ans = 0, res = 0, val = 0, ans1,
      ans2, rem = 0, diff, cnt = 0, l, r, flag = 0, e, index, val1, val2, x, y,
      z, h = 0, u, v;
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1);
  for (i = 1; i <= n; i++) {
    if (vis[i] == 0) {
      cout << "no" << endl;
      return 0;
    }
  }
  if (m == n - 1) {
    cout << "yes";
  } else
    cout << "no";
}
