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.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;
import static java.lang.Math.*;
public class Main
{
    public static void main(String[] args) {
        new Thread(null,null,"Rahsut",1<<25){
            public void run() {
                try{
                    solve();
                } catch(Exception e) {
                    e.printStackTrace();
                    System.exit(1);
                }
            }
        }.start();
    }
    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }
    static class Pair implements Comparable<Pair> {
        int x,y;
        public Pair(int x, int y) {
            this.x = x;
            this.y = y;
        }
        public int compareTo(Pair o) {
            if(x!=o.x)
                return x-o.x;
            return this.y - o.y;
        }
        public int hashCode() {
            return (int)(1L*1000000000*x + y)%1000000007;
        }
        public boolean equals(Object o) {
            if(o instanceof Pair) {
                Pair other = (Pair)o;
                return other.hashCode()==this.hashCode();
            }
            else return false;
        }
        public String toString(){
            //return x+" "+y;
            return "index = "+x +" val = "+y;
        }
    }


    //static Scanner sc = new Scanner(System.in);
    static Reader sc = new Reader();
    static StringBuilder sb = new StringBuilder();
    static PrintWriter pw = new PrintWriter(System.out,true);
    static int arr[],brr[],n,m;
    static void solve()  throws IOException {
        //write Code here
        n = sc.nextInt();m = sc.nextInt();
        arr= new int[m];
        brr= new int[m];
        for(int i =0;i<m;i++){
            arr[i]= sc.nextInt();
            brr[i]= sc.nextInt();
        }
        boolean bool = check(arr[0]);
        if(bool) {
            bool = check(brr[0]);
        }
        if(!bool)
            sb.append("YES");
        else
            sb.append("NO");


        pw.println(sb);
        pw.flush();
        pw.close();
    }
    static boolean check(int fixed) {
        Set<Integer> set = new HashSet<>();
        //temp_sec_a will be the calculted second value
        for(int i =1;i<m;i++) {
            if(arr[i]==fixed || brr[i]==fixed)
                continue;
            if(set.isEmpty()) {
                set.add(arr[i]);
                set.add(brr[i]);
                break;
            }
        }
        for(int i =1;i<m;i++) {
            if(!(arr[i]==fixed || brr[i]==fixed)) {
                Set<Integer> xyz = new HashSet<>();
                xyz.add(arr[i]);
                xyz.add(brr[i]);
                set.retainAll(xyz);
                if(set.isEmpty())
                    return true;
            }
        }

        return false;
    }
}