#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
vector<long long> veci[10001];
long long m, n;
bool mn[100001];
void dfs(int a) {
  mn[a] = 1;
  for (int i = 0; i < veci[a].size(); i++)
    if (mn[veci[a][i]] == 0) dfs(veci[a][i]);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    veci[a].push_back(b), veci[b].push_back(a);
  }
  if (n != m + 1) {
    cout << "no";
    return 0;
  }
  dfs(1);
  for (int i = 1; i <= n; i++)
    if (mn[i] == 0) {
      cout << "no";
      return 0;
    }
  cout << "yes";
}
