#include <bits/stdc++.h>
using namespace std;
struct var {
  int a, b;
  bool c;
};
int main() {
  int n, m;
  cin >> n >> m;
  struct var s[m];
  for (int i = 0; i < m; i++) {
    cin >> s[i].a >> s[i].b;
    s[i].c = 0;
  }
  bool f = 0;
  int x = s[0].a, y = s[0].b, p, q;
  for (int i = 0; i < m; i++) {
    if (s[i].a != x && s[i].b != x && s[i].a != y && s[i].b != y) {
      f = 1;
      p = s[i].a;
      q = s[i].b;
      break;
    }
  }
  if (f == 0) {
    cout << "YES";
    return 0;
  }
  int y1 = p;
  f = 0;
  for (int i = 0; i < m; i++) s[i].c = 0;
  for (int i = 0; i < m; i++) {
    if (s[i].a == x || s[i].b == x || s[i].a == y1 || s[i].b == y1) s[i].c = 1;
  }
  for (int i = 0; i < m; i++) {
    if (s[i].c == 0) {
      f = 1;
      break;
    }
  }
  if (f == 0) {
    cout << "YES";
    return 0;
  }
  if (f == 1) {
    f = 0;
    for (int i = 0; i < m; i++) s[i].c = 0;
    int y2 = q;
    for (int i = 0; i < m; i++) {
      if (s[i].a == x || s[i].b == x || s[i].a == y2 || s[i].b == y2)
        s[i].c = 1;
    }
    for (int i = 0; i < m; i++) {
      if (s[i].c == 0) {
        f = 1;
        break;
      }
    }
    if (f == 0) {
      cout << "YES";
      return 0;
    }
    if (f == 1) {
      f = 0;
      for (int i = 0; i < m; i++) s[i].c = 0;
      int x1 = y, y3 = p;
      for (int i = 0; i < m; i++) {
        if (s[i].a == x1 || s[i].b == x1 || s[i].a == y3 || s[i].b == y3)
          s[i].c = 1;
      }
      for (int i = 0; i < m; i++) {
        if (s[i].c == 0) {
          f = 1;
          break;
        }
      }
      if (f == 0) {
        cout << "YES";
        return 0;
      }
      if (f == 1) {
        f = 0;
        int y4 = q;
        for (int i = 0; i < m; i++) s[i].c = 0;
        for (int i = 0; i < m; i++) {
          if (s[i].a == x1 || s[i].b == x1 || s[i].a == y4 || s[i].b == y4)
            s[i].c = 1;
        }
        for (int i = 0; i < m; i++) {
          if (s[i].c == 0) {
            f = 1;
            break;
          }
        }
        if (f == 0) {
          cout << "YES";
          return 0;
        } else {
          cout << "NO";
          return 0;
        }
      }
    }
  }
}
