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.
//package sept;

import java.io.*;
import java.util.*;



public class TimePass implements Runnable {
    InputStream is;
    PrintWriter out;
    String INPUT = "100000 300 300";
    //boolean debug=false;
    boolean debug=true;
    static long mod=998244353;
    static long mod2=1000000007;
    
    void solve() throws IOException
    {
    	int n=ni(),m=ni();
    	int[][] a=new int[m][2];
    	HashSet<Integer> set=new HashSet<>();
    	HashSet<Integer> set2=new HashSet<>();
    	for(int i=0;i<m;i++)
    	{
    		set.add(i);
    		set2.add(i);
    		a[i][0]=ni();
    		a[i][1]=ni();
    	}
    	for(int i=0;i<m;i++)
    	{
    		if(a[i][0]==a[0][0] || a[i][1]==a[0][0])set.remove(i);
    	}
    	LinkedList<Integer> list=new LinkedList<>();
    	int fst=-1; 
    	for(int i:set)
    	{
    		if(fst==-1)fst=i;
    		if(a[i][0]==a[fst][0] || a[i][1]==a[fst][0])list.add(i);
    	}
    	int sz=list.size();
    	for(int i=0;i<sz;i++)
    	{
    		int tmp=list.removeFirst();
    		if(set.contains(tmp))
    		{
    			set.remove(tmp);
    			list.addLast(tmp);
    		}
    	}
    	if(set.size()==0)
    	{
    		out.println("YES");
    		return;
    	}
    	while(!list.isEmpty())set.add(list.removeFirst());
    	fst=-1; 
    	for(int i:set)
    	{
    		if(fst==-1)fst=i;
    		if(a[i][0]==a[fst][1] || a[i][1]==a[fst][1])list.add(i);
    	}
    	sz=list.size();
    	for(int i=0;i<sz;i++)
    	{
    		int tmp=list.removeFirst();
    		if(set.contains(tmp))
    		{
    			set.remove(tmp);
    			list.addLast(tmp);
    		}
    	}
    	if(set.size()==0)
    	{
    		out.println("YES");
    		return;
    	}
    	
    	
    	
    	for(int i=0;i<m;i++)
    	{
    		if(a[i][0]==a[0][1] || a[i][1]==a[0][1])set2.remove(i);
    	}
    	list=new LinkedList<>();
    	fst=-1; 
    	for(int i:set2)
    	{
    		if(fst==-1)fst=i;
    		if(a[i][0]==a[fst][0] || a[i][1]==a[fst][0])list.add(i);
    	}
    	sz=list.size();
    	for(int i=0;i<sz;i++)
    	{
    		int tmp=list.removeFirst();
    		if(set2.contains(tmp))
    		{
    			set2.remove(tmp);
    			list.addLast(tmp);
    		}
    	}
    	if(set2.size()==0)
    	{
    		out.println("YES");
    		return;
    	}
    	while(!list.isEmpty())set2.add(list.removeFirst());
    	fst=-1; 
    	for(int i:set2)
    	{
    		if(fst==-1)fst=i;
    		if(a[i][0]==a[fst][1] || a[i][1]==a[fst][1])list.add(i);
    	}
    	sz=list.size();
    	for(int i=0;i<sz;i++)
    	{
    		int tmp=list.removeFirst();
    		if(set2.contains(tmp))
    		{
    			set2.remove(tmp);
    			list.addLast(tmp);
    		}
    	}
    	if(set2.size()==0)
    	{
    		out.println("YES");
    		return;
    	}
    	out.println("NO");
	}
    
    boolean check(int[] a)
    {
    	for(int i:a)
    	{
    		if(i==0)return false;
    	}
    	return true;
    }
    
    void union(int[] a,LinkedList<Integer> list)
    {
    	int sz=list.size();
    	for(int i=0;i<sz;i++)
    	{
    		int tmp=list.removeFirst();
    		a[tmp]=1;
    		list.addLast(tmp);
    	}
    }
    
    LinkedList<Integer> extract(int[][] a,int val,int n)
    {
    	LinkedList<Integer> list=new LinkedList<>();
    	for(int i=0;i<n;i++)
    	{
    		if(a[i][0]==val || a[i][1]==val)list.add(i);
    	}
    	return list;
    }
    
    static long[][] dp;
    
    public long comp(int[] a,int st,int n,int m,int k)
    {
    	if(m==0)return 0;
    	long sum=0,max=0;
    	if(dp[st][m]!=-1)return dp[st][m];
    	for(int i=st;i<st+k;i++)
    	{
    		sum+=a[i];
    	}
    	long maxsum=sum;
    	max=sum+comp(a,st+k,n,m-1,k);
    	for(int i=st+k;i<n-(m-1)*k;i++)
    	{
    		sum+=a[i];
    		sum-=a[i-k];
    		maxsum=Math.max(maxsum, sum);
    		max=Math.max(max, maxsum+comp(a,i+1,n,m-1,k));
    	}
    	dp[st][m]=max;
    	return max;
    }
    
    static class DSets
    {
        int[] p;
        int[] r;
        int[] s;
        int size;
        int max_component;
        
        public DSets(int n)
        {
            s=new int[n+1];
            r=new int[n+1];
            p=new int[n+1];
            for(int i=1;i<=n;i++)
            {
                r[i]=0;
                p[i]=i;
                s[i]=1;
            }
            this.size=n+1;
        }
        
        public int find(int x)
        {
            if(x != p[x]){
                p[x] = find(p[x]) ;
            }
            return p[x] ;
        }
        
        public boolean unionBySize(int x,int y)
        {
            int rx , ry ;
            rx = find(x) ;
            ry = find(y) ;
            if(rx != ry)
            {
                if(r[rx] < r[ry])
                {
                    p[rx] = ry ;
                    s[ry] += s[rx] ;
                    max_component = Math.max(max_component,s[ry]) ;
                }
                else
                {
                    p[ry] = rx ;
                    s[rx] += s[ry] ;
                    max_component = Math.max(max_component,s[rx]) ;
                }
                if(r[rx] == r[ry])
                {
                    r[rx] ++;
                }
                return true ;
            }
            return false ;
        }
    }
    
	static Pair[][] packU(int n,int[] from,Pair[] to)
	{
		Pair[][] g=new Pair[n][];
		int[] p=new int[n];
		for(int f:from)
		{
			p[f]++;
		}
		int m=from.length;
		for(int i=0;i<n;i++)
		{
			g[i]=new Pair[p[i]];
		}
		for(int i=0;i<m;i++)
		{
			g[from[i]][--p[from[i]]]=to[i];
		}
		return g;
	}
    
	static int[][] packD(int n,int[] from,int[] to)
	{
		int[][] g=new int[n][];
		int[] p=new int[n];
		for(int f:from)
		{
			p[f]++;
		}
		int m=from.length;
		for(int i=0;i<n;i++)
		{
			g[i]=new int[p[i]];
		}
		for(int i=0;i<m;i++)
		{
			g[from[i]][--p[from[i]]]=to[i];
		}
		return g;
	}
	    
    static class Pair
    {
    	long a,b,c;
    	//int a,b,c;
        public Pair(long a,long b)
        {
            this.a=a;
            this.b=b;
            //this.ind=ind;
        }
    }
    
    static long lcm(int a,int b)
    {
        long val=a;
        val*=b;
        return (val/gcd(a,b));
    }
    
    static long gcd(long a,long b)
    {
        if(a==0)return b;
        return gcd(b%a,a);
    }
    
    static int pow(int a, int b, int p)
    {
        long ans = 1, base = a;
        while (b!=0)
        {
            if ((b & 1)!=0)
            {
                ans *= base;
                ans%= p;
            }
            base *= base;
            base%= p;
            b >>= 1;
        }
        return (int)ans;
    }

    static int inv(int x, int p)
    {
        return pow(x, p - 2, p);
    }
    
    public static long[] radixSort(long[] f){ return radixSort(f, f.length); }
	public static long[] radixSort(long[] f, int n)
	{
		long[] to = new long[n];
		{
			int[] b = new int[65537];
			for(int i = 0;i < n;i++)b[1+(int)(f[i]&0xffff)]++;
			for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
			for(int i = 0;i < n;i++)to[b[(int)(f[i]&0xffff)]++] = f[i];
			long[] d = f; f = to;to = d;
		}
		{
			int[] b = new int[65537];
			for(int i = 0;i < n;i++)b[1+(int)(f[i]>>>16&0xffff)]++;
			for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
			for(int i = 0;i < n;i++)to[b[(int)(f[i]>>>16&0xffff)]++] = f[i];
			long[] d = f; f = to;to = d;
		}
		{
			int[] b = new int[65537];
			for(int i = 0;i < n;i++)b[1+(int)(f[i]>>>32&0xffff)]++;
			for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
			for(int i = 0;i < n;i++)to[b[(int)(f[i]>>>32&0xffff)]++] = f[i];
			long[] d = f; f = to;to = d;
		}
		{
			int[] b = new int[65537];
			for(int i = 0;i < n;i++)b[1+(int)(f[i]>>>48&0xffff)]++;
			for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
			for(int i = 0;i < n;i++)to[b[(int)(f[i]>>>48&0xffff)]++] = f[i];
			long[] d = f; f = to;to = d;
		}
		return f;
	}
    
    public void run()
    {
        if(debug)oj=true;
        is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        out = new PrintWriter(System.out);
        
        long s = System.currentTimeMillis();
        try {
			solve();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        out.flush();
        tr(System.currentTimeMillis()-s+"ms");
    }
    
    public static void main(String[] args) throws Exception {new Thread(null,new TimePass(),"Main",1<<26).start();}
    
    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;
    
    private int readByte()
    {
        if(lenbuf == -1)throw new InputMismatchException();
        if(ptrbuf >= lenbuf){
            ptrbuf = 0;
            try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
            if(lenbuf <= 0)return -1;
        }
        return inbuf[ptrbuf++];
    }
    
    private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
    private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }
    
    private double nd() { return Double.parseDouble(ns()); }
    private char nc() { return (char)skip(); }
    
    private String ns()
    {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    
    private char[] ns(int n)
    {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))){
            buf[p++] = (char)b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }
    
    private char[][] nm(int n, int m)
    {
        char[][] map = new char[n][];
        for(int i = 0;i < n;i++)map[i] = ns(m);
        return map;
    }
    
    private int[] na(int n)
    {
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = ni();
        return a;
    }
    
    private int ni()
    {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }
        
        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    
    private long nl()
    {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }
        
        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    
    private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
    private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}

/*
int N=ni(),M=ni(),P=ni();
Pair[] songs=new Pair[N];
//songs Pair:a-albumType,b-price,c-greatness
int[] albPrice=new int[M];
ArrayList<Pair>[] albSongs=new ArrayList[M];
//albSongs Pair:a-price,b=index,c-greatness
for(int i=0;i<M;i++)
{
	albSongs[i]=new ArrayList<>();
}
for(int i=0;i<N;i++)
{
	songs[i]=new Pair(ni(),ni());
	songs[i].c=ni();
	Pair pr=new Pair(songs[i].b,i);
	pr.c=songs[i].c;
	albSongs[songs[i].a-1].add(pr);
}
int ind=0;
for(int i=0;i<M;i++)
{
	albPrice[i]=ni();
	for(Pair j:albSongs[i])
	{
		j.b=ind++;
	}
}
long[][] dp=new long[N][P+1];
for(int i=albSongs[0].get(0).a;i<=P;i++)
{
	dp[0][i]=albSongs[0].get(0).c;
}
//out.println(Arrays.toString(dp[0]));
long sumPrices=0,sumGreatness=0;
for(int i=1;i<=P;i++)
{
	
	//out.println("price:"+i);
	for(int j=1;j<albSongs[0].size();j++)
	{
		if(i==1)
		{
			sumPrices+=albSongs[0].get(j).a;
			sumGreatness+=albSongs[0].get(j).c;
		}
		int index=albSongs[0].get(j).b;
		
		if(i>=albSongs[0].get(j).a)
		{
			dp[index][i]=Math.max(dp[index-1][i-albSongs[0].get(j).a]+albSongs[0].get(j).c, dp[index][i]);
			if(index>0)dp[index][i]=Math.max(dp[index][i], dp[index-1][i]);
		}
		else if(index>0)dp[index][i]=Math.max(dp[index][i], dp[index-1][i]);
		
		//out.println(dp[index][i]);
	}
	
	//out.println();
}
int lastInd=albSongs[0].get(albSongs[0].size()-1).b;
for(int i=1;i<=P;i++)
{
	if(i>=sumPrices)
	{
		dp[lastInd][i]=Math.max(sumGreatness, dp[lastInd][i]);
	}
	if(i>=albPrice[0])
	{
		dp[lastInd][i]=Math.max(sumGreatness, dp[lastInd][i]);
	}
}
for(int i=1;i<=P;i++)
{
	for(int j=1;j<M;j++)
	{
		sumPrices=0;sumGreatness=0;
		for(int k=0;k<albSongs[j].size();k++)
		{
			sumPrices+=albSongs[j].get(k).a;
			sumGreatness+=albSongs[j].get(k).c;
			if(i>=albSongs[j].get(k).a)
			{
				dp[j][i]=Math.max(dp[j][i-albSongs[j].get(k).a]+albSongs[j].get(k).c, dp[j][i]);
				dp[j][i]=Math.max(dp[j][i], dp[j-1][i]);
				dp[j][i]=Math.max(dp[j][i], dp[j][i-1]);
			}
			else
			{
				dp[j][i]=Math.max(dp[j][i], dp[j][i-1]);
				dp[j][i]=Math.max(dp[j][i], dp[j-1][i]);
			}
		}
		
		if(i>=sumPrices)
		{
			dp[j][i]=Math.max(dp[j][(int) (i-sumPrices)]+sumGreatness, dp[j][i]);
		}
		if(i>=albPrice[j])
		{
			dp[j][i]=Math.max(dp[j][(int)(i-albPrice[j])]+sumGreatness, dp[j][i]);
		}
	}
}
out.println(dp[M-1][P]);

*/