#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, m;
  cin >> n >> m;
  long long int a[4];
  vector<pair<long long int, long long int> > v;
  for (long long int i = 0; i < m; i++) {
    long long int c, b;
    cin >> c >> b;
    v.push_back(make_pair(c, b));
  }
  a[0] = v[0].first, a[1] = v[0].second;
  long long int flag = 0;
  for (long long int i = 1; i < m; i++) {
    if (v[i].first != a[0] && v[i].second != a[1] && v[i].first != a[1] &&
        v[i].second != a[0]) {
      a[2] = v[i].first;
      a[3] = v[i].second;
      flag = 1;
      break;
    }
  }
  if (!flag) {
    cout << "YES";
    return 0;
  } else {
    for (long long int i = 0; i < 4; i++) {
      for (long long int j = i + 1; j < 4; j++) {
        long long int count = 0;
        for (long long int k = 0; k < m; k++)
          if (v[k].first == a[i] || v[k].second == a[i] || v[k].first == a[j] ||
              v[k].second == a[j])
            count++;
        if (count == m) {
          cout << "YES";
          return 0;
        }
      }
    }
  }
  cout << "NO";
  return 0;
}
