#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
int N = 1e6 * 5;
long double EPS = 1 / 1e18;
map<int, int> m;
map<pair<int, int>, int> m1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m2, i;
  cin >> n >> m2;
  pair<int, int> a[400000];
  for (i = 0; i < m2; i++) {
    cin >> a[i].first >> a[i].second;
    m[a[i].first]++;
    m[a[i].second]++;
    if (a[i].first < a[i].second) swap(a[i].first, a[i].second);
    m1[a[i]]++;
  }
  int x = a[0].first, y = a[0].second;
  for (i = 1; i <= n; i++) {
    if (m[i] == 0 || i == x) continue;
    if (m[i] + m[x] - m1[make_pair(max(i, x), min(i, x))] == m2) {
      cout << "YES";
      return 0;
    }
  }
  for (i = 1; i <= n; i++) {
    if (m[i] == 0 || i == y) continue;
    if (m[i] + m[y] - m1[make_pair(max(i, y), min(i, y))] == m2) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
}
