#include <bits/stdc++.h>
using namespace std;
struct Data {
  int a, b;
} data[(int)3e5 + 5];
bool vis[(int)3e5 + 5];
bool nvis[(int)3e5 + 5];
int main() {
  int n, m;
  while (cin >> n >> m) {
    memset(data, 0, sizeof(data));
    memset(vis, 0, sizeof(vis));
    memset(nvis, 0, sizeof(nvis));
    for (int i = 0; i < m; i++) {
      cin >> data[i].a >> data[i].b;
    }
    for (int cnt = 0; cnt < 2; cnt++) {
      memset(vis, 0, sizeof(vis));
      int num = cnt > 0 ? data[0].a : data[0].b;
      int postion = -1;
      for (int i = 0; i < m; i++) {
        if (data[i].a == num || data[i].b == num) {
          vis[i] = 1;
          continue;
        }
        postion = i;
      }
      if (postion == -1) {
        cout << "YES" << endl;
        break;
      }
      memcpy(nvis, vis, sizeof(vis));
      num = data[postion].a;
      bool flagA = 1;
      for (int i = 0; i < m; i++) {
        if (vis[i]) continue;
        if (data[i].a == num || data[i].b == num)
          vis[i] = 1;
        else {
          flagA = 0;
          break;
        }
      }
      memcpy(vis, nvis, sizeof(vis));
      num = data[postion].b;
      bool flagB = 1;
      for (int i = 0; i < m; i++) {
        if (vis[i]) continue;
        if (data[i].a == num || data[i].b == num)
          vis[i] = 1;
        else {
          flagB = 0;
          break;
        }
      }
      if (flagA || flagB) {
        cout << "YES" << endl;
        break;
      } else if (cnt == 1 && !flagA && !flagB) {
        cout << "NO" << endl;
      }
    }
  }
}
