Toad Ivan has m pairs of integers, each integer is between 1 and n, inclusive. The pairs are (a_1, b_1), (a_2, b_2), …, (a_m, b_m). 

He asks you to check if there exist two integers x and y (1 ≤ x < y ≤ n) such that in each given pair at least one integer is equal to x or y.

Input

The first line contains two space-separated integers n and m (2 ≤ n ≤ 300 000, 1 ≤ m ≤ 300 000) — the upper bound on the values of integers in the pairs, and the number of given pairs.

The next m lines contain two integers each, the i-th of them contains two space-separated integers a_i and b_i (1 ≤ a_i, b_i ≤ n, a_i ≠ b_i) — the integers in the i-th pair.

Output

Output "YES" if there exist two integers x and y (1 ≤ x < y ≤ n) such that in each given pair at least one integer is equal to x or y. Otherwise, print "NO". You can print each letter in any case (upper or lower).

Examples

Input


4 6
1 2
1 3
1 4
2 3
2 4
3 4


Output


NO


Input


5 4
1 2
2 3
3 4
4 5


Output


YES


Input


300000 5
1 2
1 2
1 2
1 2
1 2


Output


YES

Note

In the first example, you can't choose any x, y because for each such pair you can find a given pair where both numbers are different from chosen integers.

In the second example, you can choose x=2 and y=4.

In the third example, you can choose x=1 and y=2.
#include <bits/stdc++.h>
using namespace std;
const long long inf = LLONG_MAX;
const long long mod = 1000000007;
long long gcd(long long a, long long b) {
  if (!a || !b) return a | b;
  unsigned shift = __builtin_ctz(a | b);
  a >>= __builtin_ctz(a);
  do {
    b >>= __builtin_ctz(b);
    if (a > b) swap(a, b);
    b -= a;
  } while (b);
  return a << shift;
}
long long gcd(long long a, long long b, long long& x, long long& y) {
  x = 1, y = 0;
  long long x1 = 0, y1 = 1, a1 = a, b1 = b;
  while (b1) {
    long long q = a1 / b1;
    tie(x, x1) = make_tuple(x1, x - q * x1);
    tie(y, y1) = make_tuple(y1, y - q * y1);
    tie(a1, b1) = make_tuple(b1, a1 - q * b1);
  }
  return a1;
}
long long bits(long long x) {
  long long res = 0;
  while (x) {
    x = (x >> 1);
    res++;
  }
  return res;
}
long long power(long long x, long long y, long long p) {
  if (!y) return 1;
  long long z = power(x, y / 2, p);
  z = (z * z) % p;
  if (y % 2) z = (z * x) % p;
  return z;
}
class bit {
 private:
  long long n;
  vector<long long> t;

 public:
  bit() {}
  bit(long long init) {
    n = init;
    t.assign(init + 1, 0);
  }
  long long sum(long long r) {
    long long ans = 0;
    for (; r >= 0; r = (r & (r + 1)) - 1) ans += t[r];
    return ans;
  }
  void update(long long i, long long delta) {
    for (; i < n; i = i | (i + 1)) t[i] += delta;
  }
  void range_update(long long l, long long r, long long x) {
    update(l, x);
    update(r + 1, -x);
  }
  long long point_query(long long i) { return sum(i); }
};
long long f(long long x, vector<set<long long>> a) {
  vector<bool> used(a.size(), false);
  long long cnt = a.size();
  for (long long i = 0; i < a.size(); i++) {
    if (a[i].find(x) != a[i].end()) {
      used[i] = true;
      cnt--;
    }
  }
  if (cnt == 0) return 0;
  map<long long, long long> ys;
  for (long long i = 0; i < a.size(); i++) {
    if (!used[i]) {
      ys[*a[i].begin()]++;
      ys[*a[i].rbegin()]++;
    }
  }
  for (auto y : ys) {
    if (y.second == cnt) return y.first;
  }
  return -1;
}
void solve() {
  long long n, m;
  cin >> n >> m;
  vector<set<long long>> a(m);
  for (long long i = 0; i < m; i++) {
    long long x;
    cin >> x;
    a[i].insert(x);
    cin >> x;
    a[i].insert(x);
  }
  long long x, y;
  x = *a[0].begin();
  y = f(x, a);
  if (y >= 0) {
    cout << "YES" << endl;
    return;
  }
  x = *a[0].rbegin();
  y = f(x, a);
  if (y >= 0) {
    cout << "YES" << endl;
    return;
  }
  cout << "NO" << endl;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
