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 B {
    
    class Pair {
        int a,b;

        public Pair(int a, int b) {
            this.a = a;
            this.b = b;
        }
    }

    void solve() {
        int n = in.nextInt();
        int m = in.nextInt();
        List<Pair> pairs = new ArrayList<>();
        for (int i = 0; i < m; i++) {
            pairs.add(new Pair(in.nextInt(), in.nextInt()));
        }
        
        boolean fit = fit(pairs);
        
        if (fit) {
            out.println("YES");
        } else {
            out.println("NO");
        }

    }

    private boolean fit(List<Pair> pairs) {
        int selected = pairs.get(0).a;
        
        List<Pair> other = getNotContainingGroup(pairs, selected);
        if (other.size() == 0) return true;
        
        int secondSelected = other.get(0).a;
        if (isGrouped(other, secondSelected)) return true;
        
        secondSelected = other.get(0).b;
        if (isGrouped(other, secondSelected)) return true;
        
        
        selected = pairs.get(0).b;
        other = getNotContainingGroup(pairs, selected);
        if (other.size() == 0) return true;

        secondSelected = other.get(0).a;
        if (isGrouped(other, secondSelected)) return true;

        secondSelected = other.get(0).b;
        if (isGrouped(other, secondSelected)) return true;
        
        return false;
    }
    
    private List<Pair> getNotContainingGroup(List<Pair> pairs, int selected) {
        List<Pair> other = new ArrayList<>();

        for (Pair p : pairs) {
            if (p.a != selected && p.b != selected) {
                other.add(p);
            }
        }
        return other;
    }

    private boolean isGrouped(List<Pair> other, int selected) {
        boolean grouped = true;
        for (Pair p : other) {
            if (p.a != selected && p.b != selected) {
                grouped = false;
                break;
            }
        }
        return grouped;
    }


    Scanner in;
    PrintWriter out;

    void run() {
        try {
            in = new Scanner(new File("A.in"));
            out = new PrintWriter(new File("A.out"));

            solve();

            out.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    void runIO() {

        in = new Scanner(System.in);
        out = new PrintWriter(System.out);

        solve();

        out.close();
    }

    class Scanner {
        BufferedReader br;
        StringTokenizer st;

        public Scanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

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

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        private boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        }

        private int skip() {
            int b;
            while ((b = read()) != -1 && isSpaceChar(b)) ;
            return b;
        }

        private int read() {
            int res = -1;
            try {
                res = br.read();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return res;
        }

        char[] nextCharArray(int size) {
            char[] buf = new char[size];
            int b = skip(), p = 0;
            while (p < size && !(isSpaceChar(b))) {
                buf[p++] = (char) b;
                b = read();
            }
            return size == p ? buf : Arrays.copyOf(buf, p);
        }

        char[][] nextCharMap(int n, int m) {
            char[][] map = new char[n][];
            for (int i = 0; i < n; i++) {
                map[i] = nextCharArray(m);
            }
            return map;
        }

        int[] na(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }
            return arr;
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

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

        long nextLong() {
            return Long.parseLong(next());
        }

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

    public static void main(String[] args) {
        new B().runIO();
    }
}


