#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
const int INF = 1e9 + 5;
const double PI = acos(-1);
const int X[] = {1, -1, 0, 0};
const int Y[] = {0, 0, 1, -1};
int n, m, a[N], b[N];
vector<int> v;
map<int, int> cnt1, cnt2;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a[i] >> b[i];
    cnt1[a[i]]++;
    cnt1[b[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    if (cnt1[i] >= m / 2) {
      v.push_back(i);
    }
  }
  for (int i = 0; i < v.size(); i++) {
    int x = v[i];
    cnt2.clear();
    for (int j = 1; j <= m; j++) {
      if (a[j] == x || b[j] == x) {
        continue;
      }
      cnt2[a[j]]++;
      cnt2[b[j]]++;
    }
    for (int y = 1; y <= n; y++) {
      if (cnt1[x] + cnt2[y] >= m) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
