text: /* ========================================
  
     ID: mathema6
     TASK: D
     LANG: C++14
  
     * File Name : D.cpp
     * Creation Date : 11-12-2021
     * Last Modified : Sat 11 Dec 2021 01:24:23 PM CET
     * Created By : Karel Ha <mathemage@gmail.com>
     * URL : https://atcoder.jp/contests/abc231/tasks/abc231_d
     * Points/Time :
     * Total/ETA : 400 pts
     * Status :
     * WA :-/
     *
     ==========================================*/
  
  #define PROBLEMNAME "D"
  
  #include <bits/stdc++.h>
  
  using namespace std;
  
  #define endl "\n"
  #define REP(i,n) for(ll i=0;i<(n);i++)
  #define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
  #define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
  #define REPi(i,n) for(int i=0;i<(n);i++)
  #define FORi(i,a,b) for(int i=(a);i<=(b);i++)
  #define FORDi(i,a,b) for(int i=(a);i>=(b);i--)
  #define ALL(A)     (A).begin(), (A).end()
  #define REVALL(A)     (A).rbegin(), (A).rend()
  #define F first
  #define S second
  #define OP first
  #define CL second
  #define PB push_back
  #define MP make_pair
  #define MTP make_tuple
  #define SGN(X) ((X) ? ( (X)>0?1:-1 ) : 0)
  #define CONTAINS(S,E) ((S).find(E) != (S).end())
  #define SZ(x) ((ll) (x).size())
  // #define SZi(x) ((int) (x).size())
  #define YES cout << "YES" << endl;
  #define NO cout << "NO" << endl;
  #define YN(b) cout << ((b)?"YES":"NO") << endl;
  #define Yes cout << "Yes" << endl;
  #define No cout << "No" << endl;
  #define Yn(b) cout << ((b)?"Yes":"No") << endl;
  #define Imp cout << "Impossible" << endl;
  #define IMP cout << "IMPOSSIBLE" << endl;
  
  using ll = long long;
  using ul = unsigned long long;
  // using ulul = pair<ul, ul>;
  using ld = long double;
  using graph_unord = unordered_map<ll, vector<ll>>;
  using graph_ord  = map<ll, set<ll>>;
  using graph_t    = graph_unord;
  
  #ifdef ONLINE_JUDGE
    #undef MATHEMAGE_DEBUG
  #endif
  
  #ifdef MATHEMAGE_DEBUG
    #define MSG(a) cerr << "> " << (#a) << ": " << (a) << endl;
    #define MSG_VEC_VEC(v) cerr << "> " << (#v) << ":\n" << (v) << endl;
    #define LINESEP1 cerr << "-----------------------------------------------                  " << endl;
    #define LINESEP2 cerr << "_________________________________________________________________" << endl;
  #else
    #define MSG(a)
    #define MSG_VEC_VEC(v)
    #define LINESEP1
    #define LINESEP2
  #endif
  
  ostream& operator<<(ostream& os, const vector<string> & vec) { os << endl; for (const auto & s: vec) os << s << endl; return os; }
  
  template<typename T> 
  ostream& operator<<(ostream& os, const vector<T> & vec) { for (const auto & x: vec) os << x << " "; return os; } 
  
  template<typename T> 
  ostream& operator<<(ostream& os, const vector<vector<T>> & vec) { for (const auto & v: vec) os << v << endl; return os; } 
  
  template<typename T>
  inline ostream& operator<<(ostream& os, const vector<vector<vector<T>>> & vec) {
    for (const auto & row: vec) {
      for (const auto & col: row) {
        os << "[ " << col << "]   ";
      }
      os << endl;
    }
    return os;
  }
  
  template<typename T, class Compare>
  ostream& operator<<(ostream& os, const set<T, Compare>& vec) { for (const auto & x: vec) os << x << " "; os << endl; return os; } 
  
  template<typename T, class Compare>
  ostream& operator<<(ostream& os, const multiset<T, Compare>& vec) { for (const auto & x: vec) os << x << " "; os << endl; return os; }
  
  template<typename T1, typename T2>
  ostream& operator<<(ostream& os, const map<T1, T2>& vec) { for (const auto & x: vec) os << x.F << ":" << x.S << " | "; return os; }
  
  template<typename T1, typename T2>
  ostream& operator<<(ostream& os, const unordered_map<T1, T2>& vec) { for (const auto & x: vec) os << x.F << ":" << x.S << " | "; return os; }
  
  template<typename T1, typename T2>
  ostream& operator<<(ostream& os, const pair<T1, T2>& p) { return os << "(" << p.F << ", " << p.S << ")"; }
  
  template<typename T>
  istream& operator>>(istream& is, vector<T> & vec) { for (auto & x: vec) is >> x; return is; }
  
  template<typename T>
  inline bool bounded(const T & x, const T & u, const T & l=0) { return min(l,u)<=x && x<max(l,u); }
  
  template<class T> bool umin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
  template<class T> bool umax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
  
  // inline bool eqDouble(double a, double b) { return fabs(a-b) < 1e-9; }
  inline bool eqDouble(ld a, ld b) { return fabs(a-b) < 1e-9; }
  inline bool isCollinear(ld x, ld y, ld x1, ld y1, ld x2, ld y2) {
    // (x-x1)/(y-y1) == (x-x2)/(y-y2)
    // (x-x1)*(y-y2) == (x-x2)*(y-y1)
    return eqDouble((x-x1)*(y-y2), (x-x2)*(y-y1));
  }
  inline bool isBetween(ld x, ld y, ld x1, ld y1, ld x2, ld y2) {
    return min(x1,x2)<=x && x<=max(x1,x2)
        && min(y1,y2)<=y && y<=max(y1,y2);
  }
  inline bool onLine(ld x, ld y, ld x1, ld y1, ld x2, ld y2) {
    return isCollinear(x, y, x1, y1, x2, y2) && isBetween(x, y, x1, y1, x2, y2);
  }
  
  
  #ifndef MATHEMAGE_LOCAL
  void setIO(string filename) {    // the argument is the filename without the extension
  	freopen((filename+".in").c_str(), "r", stdin);
  	freopen((filename+".out").c_str(), "w", stdout);
    MSG(filename);
  }
  #endif
  
  const vector<int> DX8 = {-1, -1, -1,   0, 0,   1,  1,  1};
  const vector<int> DY8 = {-1,  0,  1,  -1, 1,  -1,  0,  1};
  const vector<pair<int,int>> DXY8 = {
    {-1,-1}, {-1,0}, {-1,1},
    { 0,-1},         { 0,1},
    { 1,-1}, { 1,0}, { 1,1}
  };
  
  const vector<int> DX4 = {0, 1,  0, -1};
  const vector<int> DY4 = {1, 0, -1,  0};
  const vector<pair<int,int>> DXY4 = { {0,1}, {1,0}, {0,-1}, {-1,0} };
  const string dues="NESW";
  
  const int CLEAN = -1;
  const int UNDEF = -42;
  const long long MOD = 1000000007;
  const double EPS = 1e-8;
  const ld PI = acos((ld)-1);
  
  const int INF = INT_MAX;
  const long long INF_LL = LLONG_MAX;
  const long long INF_ULL = ULLONG_MAX;
  
  
  void solve() {
    ll N,M; cin >> N >> M;
    graph_t adj;
    ll Ai,Bi;
    REP(_,M) {
      cin >> Ai >> Bi;
      adj[Ai].PB(Bi);
      adj[Bi].PB(Ai);
    }
  
    bool result = true;
    for (auto & [at,out]: adj) {
      result &= SZ(out) <= 2;
    }
    cout << ((result)?"Yes":"No") << endl;
  }
  
  int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout << std::setprecision(10) << std::fixed;
  
  #ifndef MATHEMAGE_LOCAL
  //   setIO(PROBLEMNAME);
  #endif
  
    int cases = 1;
    FOR(tt,1,cases) {
  //     cout << "Case #" << tt << ": ";
      solve();
      LINESEP2;
    }
    return 0;
  }
  