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.
import java.io.*;
import java.util.*;

public class tr0 {
	static PrintWriter out;
	static StringBuilder sb;
	static long mod =1000000007;
 //   static int a,bb;
    static long[]fac;
//    static pair []k;
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n=sc.nextInt();
		int m=sc.nextInt();
		pair []a=new pair [m];
		for(int i=0;i<m;i++) {
			int x=sc.nextInt();
			int y=sc.nextInt();
			a[i]=new pair(Math.min(x, y), Math.max(x, y)); 
		}
		TreeSet<pair> t=new TreeSet<>();
		for(int i=0;i<m;i++)
			t.add(a[i]);
		//out.println(t);
		//System.out.println(t);
		if(t.size()<3) {
			System.out.println("YES");
			return;
		}
		TreeSet<Integer> ans=new TreeSet<>();
		TreeSet<Integer> possible=new TreeSet<>();
		pair l=null;
		for(pair k:t) {
			if(l!=null) {
				if(l.t==k.d) {
					ans.add(k.d);
					possible.add(k.t);
					possible.add(l.d);
					break;
				}
				if(l.d==k.d) {
					ans.add(k.d);
					possible.add(k.t);
					possible.add(l.t);
					break;
				}
				if(l.t==k.t) {
					ans.add(k.t);
					possible.add(k.d);
					possible.add(l.d);
					break;
				}
				if(l.d==k.t) {
					ans.add(k.t);
					possible.add(k.d);
					possible.add(l.t);
					break;
				}
			}
			l=k;
		}
		TreeSet<pair> t2=new TreeSet<>();
		if(ans.size()==0) {
			System.out.println("NO");
			return;
		}
		for(pair k:t) {
			if(k.d!=ans.first() && k.t!=ans.first()) {
				t2.add(k);
			}
		}
		//System.out.println(t2);
		if(t2.size()<2) {
			System.out.println("YES");
			return;
		}
		l=null;
		int ss=0;
		for(pair k:t2) {
			if(l!=null) {
				if(l.t==k.d) {
					ans.add(k.d);
				ss=k.d;
					break;
				}
				if(l.d==k.d) {
					ans.add(k.d);
					ss=k.d;
					break;
				}
				if(l.t==k.t) {
					ans.add(k.t);
					ss=k.t;
					break;
				}
				if(l.d==k.t) {
					ans.add(k.t);
					ss=k.t;
					break;
				}
			}
			l=k;
		}
	   TreeSet<pair> t3=new TreeSet<>();
	   for(pair k:t2) {
			if(k.d!=ss && k.t!=ss) {
				t3.add(k);
			}
		}
	   if(t3.isEmpty()) {
		   System.out.println("YES");
		   return;
	   }
	   boolean f=true;
	   //System.out.println(possible);
	   for(int i=0;i<m && possible.size()==2;i++) {
		   if(a[i].t==possible.first() || a[i].t==possible.last() || a[i].d==possible.first() || a[i].d==possible.last()) {
			   f=true;
		   }
		   else {
			   f=false;
			   break;
		   }
	   }
	   if(f) {
		   System.out.println("YES");
		   return;
	   }
		out.println("NO");
		out.flush();
	}
	   static long inver(long x){
           int a = (int) x;
           long e=(mod-2);
           long res = 1;
           while(e > 0)
           {
               if((e & 1) == 1) {
                   //System.out.println(res*a);
                   res = (int) ((1l*res * a) % mod);
               }
               a = (int) ((1l*a * a) % mod);
               e >>= 1;
           }
           //out.println(res+" "+x);
           return res%mod;
   }
	static public class segmentTree {
		int[] array, lazy;
		sol[] tree;
		int n;

		segmentTree(int[] aa) {
			array = aa;
			n = array.length - 1;
			tree = new sol[n * 4];
	//		lazy = new int[n * 4];
	//		Arrays.fill(lazy, -1);
			build(1, 1, n);
		}

		public String toString() {
			return Arrays.toString(tree);
		}

		void build(int node, int l, int r) {
			if (l == r)
				tree[node] =new sol(true,array[r],array[r],'e');
			else {
				int mid = (l + r) >> 1;
				build(node << 1, l, mid);
				build((node << 1) | 1, mid + 1, r);
				if(!tree[node<<1].st || !tree[(node<<1)|1].st) {
					tree[node]=new sol(false,tree[node<<1].l,tree[node<<1|1].r,'n');
				}
				else if(tree[node<<1].s=='l' && tree[(node<<1)|1].s=='l') {
					tree[node]=new sol(false,tree[node<<1].l,tree[node<<1|1].r,'n');
				}
				else if(tree[node<<1].s=='l') {
					if(tree[(node<<1)|1].s=='e' && tree[(node<<1)|1].l<=tree[(node<<1)].r)
						tree[node]=new sol(true,tree[node<<1].l,tree[node<<1|1].r,'l');
					else if(tree[(node<<1)|1].s=='s' && tree[(node<<1)|1].l>=tree[(node<<1)|1].r && tree[(node<<1)|1].l<=tree[(node<<1)].r)
						tree[node]=new sol(true,tree[node<<1].l,tree[node<<1|1].r,'l');
					else
						tree[node]=new sol(false,tree[node<<1].l,tree[node<<1|1].r,'n');
				}
				else if(tree[(node<<1)|1].s=='l') {
					if(tree[(node<<1)].s=='e' && tree[(node<<1)].r<=tree[(node<<1)|1].l)
						tree[node]=new sol(true,tree[node<<1].l,tree[node<<1|1].r,'l');
					else if(tree[(node<<1)].s=='s' && tree[(node<<1)].r>=tree[(node<<1)].l && tree[(node<<1)].r<=tree[(node<<1)|1].l)
						tree[node]=new sol(true,tree[node<<1].l,tree[node<<1|1].r,'l');
					else
						tree[node]=new sol(false,tree[node<<1].l,tree[node<<1|1].r,'n');
				}
				else if(tree[node<<1].s=='e' && tree[(node<<1)|1].s=='e') {
					tree[node]=new sol(true,tree[node<<1].l,tree[node<<1|1].r,'s');
				}
				else if(tree[node<<1].s=='s' && tree[(node<<1)|1].s=='s') {
					if(tree[node<<1].r>=tree[node<<1].l && tree[node<<1|1].r<=tree[node<<1|1].l)
						tree[node]=new sol(true,tree[node<<1].l,tree[node<<1|1].r,'l');
					else if(tree[node<<1].r>=tree[node<<1].l && tree[node<<1|1].l>=tree[node<<1].r && tree[node<<1|1].r>=tree[node<<1|1].l)
						tree[node]=new sol(true,tree[node<<1].l,tree[node<<1|1].r,'s');
					else if(tree[node<<1].l>=tree[node<<1].r && tree[node<<1|1].l<=tree[node<<1].r && tree[node<<1|1].l>=tree[node<<1|1].r)
						tree[node]=new sol(true,tree[node<<1].l,tree[node<<1|1].r,'s');
					else
						tree[node]=new sol(false,tree[node<<1].l,tree[node<<1|1].r,'n');
				}
				else if(tree[node<<1].s=='s') {
					if(tree[node<<1].r>=tree[node<<1].l && tree[node<<1|1].l>=tree[node<<1].r)
						tree[node]=new sol(true,tree[node<<1].l,tree[node<<1|1].r,'s');
					else if(tree[node<<1].r>=tree[node<<1].l)
						tree[node]=new sol(true,tree[node<<1].l,tree[node<<1|1].r,'l');
					else if(tree[node<<1].l>=tree[node<<1].r && tree[node<<1|1].l <=tree[node<<1].r)
						tree[node]=new sol(true,tree[node<<1].l,tree[node<<1|1].r,'l');
					else
						tree[node]=new sol(false,tree[node<<1].l,tree[node<<1|1].r,'n');
				}
				else if(tree[(node<<1)|1].s=='s') {
					if(tree[node<<1|1].r>=tree[node<<1|1].l && tree[node<<1].r<=tree[node<<1|1].l)
						tree[node]=new sol(true,tree[node<<1].l,tree[node<<1|1].r,'s');
					else if(tree[node<<1|1].r>=tree[node<<1|1].l)
						tree[node]=new sol(false,tree[node<<1].l,tree[node<<1|1].r,'n');
					else if(tree[node<<1|1].l>=tree[node<<1|1].r && tree[node<<1].r>=tree[node<<1|1].l)
						tree[node]=new sol(true,tree[node<<1].l,tree[node<<1|1].r,'s');
					else
						tree[node]=new sol(true,tree[node<<1].l,tree[node<<1|1].r,'l');
				}
		//		else
			//		tree[node]=new sol(false,tree[node<<1].l,tree[node<<1|1].r,'n');
			}
		}

	/*	void updateRange(int i, int j, int v) {
			updateR(1, 1, n, i, j, v);
		}

		void updateR(int node, int l, int r, int i, int j, int v) {
			if (i > r || j < l)
				return;
			if (i <= l && j >= r) {
				tree[node] = (r - l + 1) * v;
				lazy[node] = v;
			} else {
				int mid = l + r >> 1;
				propagate(node, l, mid, r);
				updateR(node << 1, l, mid, i, j, v);
				updateR(node << 1 | 1, mid + 1, r, i, j, v);
				tree[node] = tree[node << 1] + tree[node << 1 | 1];
			}
		}

		void propagate(int node, int b, int mid, int e) {
			if (lazy[node] != -1) {
				lazy[node << 1] = lazy[node];
				lazy[node << 1 | 1] = lazy[node];
				tree[node << 1] = (mid - b + 1) * lazy[node];
				tree[node << 1 | 1] = (e - mid) * lazy[node];
			}
			lazy[node] = -1;
		}*/

		sol query(int i, int j) {
			return query(1, 1, n, i, j);
		}

		sol query(int node, int b, int e, int i, int j) // O(log n)
		{
			if (i > e || j < b)
				return null;
			if (b >= i && e <= j)
				return tree[node];
			int mid = b + e >> 1;
//			propagate(node, b, mid, e);
			sol q1 = query(node << 1, b, mid, i, j);
			sol q2 = query(node << 1 | 1, mid + 1, e, i, j);
			if(q1==null)
				return q2;
			if(q2==null)
				return q1;
			sol q3=null;
			if(!q1.st || !q2.st) {
				q3=new sol(false,q1.l,q2.r,'n');
			}
			else if(q1.s=='l' && q2.s=='l') {
				q3=new sol(false,q1.l,q2.r,'n');
			}
			else if(q1.s=='l') {
				if(q2.s=='e' && q2.l<=q1.r)
					q3=new sol(true,q1.l,q2.r,'l');
				else if(q2.s=='s' && q2.l>=q2.r && q2.l<=q1.r)
					q3=new sol(true,q1.l,q2.r,'l');
				else
					q3=new sol(false,q1.l,q2.r,'n');
			}
			else if(q2.s=='l') {
				if(q1.s=='e' && q1.r<=q2.l)
					q3=new sol(true,q1.l,q2.r,'l');
				else if(q1.s=='s' && q1.r>=q1.l && q1.r<=q2.l)
					q3=new sol(true,q1.l,q2.r,'l');
				else
					q3=new sol(false,q1.l,q2.r,'n');
			}
			else if(q1.s=='e' && q2.s=='e') {
				q3=new sol(true,q1.l,q2.r,'s');
			}
			else if(q1.s=='s' && q2.s=='s') {
				if(q1.r>=q1.l && q2.r<=q2.l)
					q3=new sol(true,q1.l,q2.r,'l');
				else if(q1.r>=q1.l && q2.l>=q1.r && q2.r>=q2.l)
					q3=new sol(true,q1.l,q2.r,'s');
				else if(q1.l>=q1.r && q2.l<=q1.r && q2.l>=q2.r)
					q3=new sol(true,q1.l,q2.r,'s');
				else
					q3=new sol(false,q1.l,q2.r,'n');
			}
			else if(q1.s=='s') {
				if(q1.r>=q1.l && q2.l>=q1.r)
					q3=new sol(true,q1.l,q2.r,'s');
				else if(q1.r>=q1.l)
					q3=new sol(true,q1.l,q2.r,'l');
				else if(q1.l>=q1.r && q2.l <=q1.r)
					q3=new sol(true,q1.l,q2.r,'l');
				else
					q3=new sol(false,q1.l,q2.r,'n');
			}
			else if(q2.s=='s') {
				if(q2.r>=q2.l && q1.r<=q2.l)
					q3=new sol(true,q1.l,q2.r,'s');
				else if(q2.r>=q2.l)
					q3=new sol(false,q1.l,q2.r,'n');
				else if(q2.l>=q2.r && q1.r>=q2.l)
					q3=new sol(true,q1.l,q2.r,'s');
				else
					q3=new sol(true,q1.l,q2.r,'l');
			}
			return q3 ;

		}

	}

	static long fac(int n) {
		if (n == 0)
			return fac[n]=1;
		if (n == 1)
			return fac[n]=1;
		long ans = 1;
		for (int i = 1; i <= n; i++)
			fac[i]=ans = (i % mod * ans % mod) % mod;
		return ans % mod;
	}

	static long gcd(long a, long b) {

		if (b == 0)
			return a;
		return gcd(b, a % b);
	}

	static class sol{
		boolean st;
		int l;
		int r;
		char s;
		sol(boolean st,int l,int r,char s){
		this.st=st;
		this.l=l;
		this.r=r;
		this.s=s;
		}
		public String toString() {
			return st+" "+l+" "+r+" "+s;
		}
	}
	static class pair implements Comparable<pair>{
		int d;
		int t;

		pair(int d,int t){
			this.d=d;
			this.t=t;
		}
		public String toString() {
			return d + " " + t;
		}

		public int compareTo(pair o) {
			if(o.d==d)
				return -o.t+t; 
			return -o.d + d;
		}
	}

	static class unionfind {
		int[] p;
		int[] size;

		unionfind(int n) {
			p = new int[n];
			size = new int[n];

			for (int i = 0; i < n; i++) {
				p[i] = i;
			}
			Arrays.fill(size, 1);
		}

		int findSet(int v) {
			if (v == p[v])
				return v;
			return p[v] = findSet(p[v]);
		}

		boolean sameSet(int a, int b) {
			a = findSet(a);
			b = findSet(b);
			if (a == b)
				return true;
			return false;
		}

		int max() {
			int max = 0;
			for (int i = 0; i < size.length; i++)
				if (size[i] > max)
					max = size[i];
			return max;
		}

		void combine(int a, int b) {
			a = findSet(a);
			b = findSet(b);
			if (a == b)
				return;
			if (size[a] > size[b]) {
				p[b] = a;
				size[a] += size[b];

			} else {
				p[a] = b;
				size[b] += size[a];
			}
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}