Since the giant heads have appeared in the sky all humanity is in danger, so all Ricks and Mortys from all parallel universes are gathering in groups to find a solution to get rid of them. 

There are n parallel universes participating in this event (n Ricks and n Mortys). I. e. each of n universes has one Rick and one Morty. They're gathering in m groups. Each person can be in many groups and a group can contain an arbitrary number of members.

Ricks and Mortys have registered online in these groups. So, a person can have joined a group more than once (developer of this website hadn't considered this possibility).

<image>

Summer from universe #1 knows that in each parallel universe (including hers) exactly one of Rick and Morty from that universe is a traitor and is loyal, but no one knows which one. She knows that we are doomed if there's a group such that every member in that group is a traitor (they will plan and destroy the world). 

Summer knows that if there's a possibility that world ends (there's a group where all members are traitors) she should immediately cancel this event. So she wants to know if she should cancel the event. You have to tell her yes if and only if there's at least one scenario (among all 2n possible scenarios, 2 possible scenarios for who a traitor in each universe) such that in that scenario the world will end.

Input

The first line of input contains two integers n and m (1 ≤ n, m ≤ 104) — number of universes and number of groups respectively.

The next m lines contain the information about the groups. i-th of them first contains an integer k (number of times someone joined i-th group, k > 0) followed by k integers vi, 1, vi, 2, ..., vi, k. If vi, j is negative, it means that Rick from universe number  - vi, j has joined this group and otherwise it means that Morty from universe number vi, j has joined it.

Sum of k for all groups does not exceed 104.

Output

In a single line print the answer to Summer's question. Print "YES" if she should cancel the event and "NO" otherwise.

Examples

Input

4 2
1 -3
4 -2 3 2 -3


Output

YES


Input

5 2
5 3 -2 1 -1 5
3 -5 2 5


Output

NO


Input

7 2
3 -1 6 7
7 -5 4 2 4 7 -3 4


Output

YES

Note

In the first sample testcase, 1st group only contains the Rick from universe number 3, so in case he's a traitor, then all members of this group are traitors and so Summer should cancel the event.
import java.io.*;
import java.util.*;

/**
 * Created by prassingh on 2/26/17.
 */
public class Fibonacci {

    private int numA;
    private int numB;

    private Fibonacci(int num1, int num2) {
        this.numA = num1;
        this.numB = num2;
    }

    public static void main(String[] args) throws IOException {
        Reader.init(System.in);
        Print print = new Print();

        int n = Reader.nextInt();
        int m = Reader.nextInt();

        boolean ans = false;
        int count = 0;
        for (int i = 0 ; i < m ; ++i) {
            int p = Reader.nextInt();
            ans = false;
            Map<Integer,Boolean> map = new HashMap<Integer, Boolean>();
            for (int j = 0 ; j < p ; ++j){
                int temp = Reader.nextInt();
                map.put(temp,true);
                if ((map.get(temp*(-1))!= null) &&  map.get(temp*(-1))) {
                    ans = true;
                }
            }
            if (ans) {
                count++;
            }
        }

        if (count == m) {
            print.println("NO");
        } else {
            print.println("YES");
        }

//        for (int i = 0; i< 2; i++) {
//            String test = Reader.nextLine();
//            print.print("last character is : ".concat(test.charAt(test.length()-1) + ""));
//            print.println(test);
//        }

//        int n = Reader.nextInt();
//        int k = Reader.nextInt();
//        int numA[] = new int[n];
//        int numB[] = new int[n];
//        Fibonacci fibArray[] = new Fibonacci[n];
//
//        for (int i= 0; i< n; ++i) {
//            numA[i] = Reader.nextInt();
//        }
//
//        for (int i= 0; i< n; ++i) {
//            numB[i] = Reader.nextInt();
//        }
//
//        for (int i= 0; i< n; ++i) {
//            fibArray[i] = new Fibonacci(numA[i], numB[i]);
//        }
//
//        Arrays.sort(fibArray, new FibonacciComparator());
//
////        for (int i=0; i<n; ++i) {
////            print.print(i);
////            print.print(fibArray[i].getNumA());
////            print.print(" ");
////            print.print(fibArray[i].getNumB());
////            print.println(" ");
////        }
//
//        int ans = 0;
//        for (int i=0; i< n ; ++i) {
//            if (i<k || fibArray[i].getNumA() <= fibArray[i].getNumB()) {
//                ans += fibArray[i].getNumA();
//            } else {
//                ans += fibArray[i].getNumB();
//            }
//        }
//
//        print.print(ans);
//
//        int n = 213;
//        ArrayList<Integer> numArray = new ArrayList<>();
//        while (n > 0) {
//            numArray.add(n%10);
//            n/=10;
//        }
//        print.println(numArray);
//        Collections.sort(numArray);
//        //int check = Integer.parseInt(temp);
//        Collections.reverse(numArray);
//        print.println(numArray);
//        print.println(arrayToInt(numArray));
//        boolean visit[][] = new boolean[10][10];
//        //Arrays.fill(visit[0],false);
//        print.println(visit[0][4]);
//        print.println(visit[9][6]);
//        print.close();


//        HashMap<String, String> codenames = new HashMap<String, String>();
//
//        Set<Map.Entry<String, String>> entries = codenames.entrySet();
//
//        List<Map.Entry<String, String>> list = new ArrayList<Map.Entry<String, String>>(entries);
//        Collections.sort(list, new Comparator<Map.Entry<String, String>>() {
//            @Override
//            public int compare(Map.Entry<String, String> o1, Map.Entry<String, String> o2) {
//                return o1.getValue().compareTo(o2.getValue());
//            }
//        });
//        for(Map.Entry<String, String> entry:list){
//            System.out.println(entry.getKey()+" ==== "+entry.getValue());
//        }

        print.close();

    }

    private static int arrayToInt(ArrayList<Integer> input) {
        int ans = 0;
        for (Integer i: input) {
            ans = 10*ans + i;
        }
        return ans;
    }

    public int getNumA() {
        return numA;
    }

    public void setNumA(int numA) {
        this.numA = numA;
    }

    public int getNumB() {
        return numB;
    }

    public void setNumB(int numB) {
        this.numB = numB;
    }
}

class FibonacciComparator implements Comparator<Fibonacci> {

    @Override
    public int compare(Fibonacci o1, Fibonacci o2) {
        if (((o1.getNumA() - o1.getNumB()) > (o2.getNumA() - o2.getNumB()))) {
            return 1;
        } else if (((o1.getNumA() - o1.getNumB()) < (o2.getNumA() - o2.getNumB()))) {
            return -1;
        } else {
            return 0;
        }
    }
}


/** Class for buffered reading int and double values */
class Reader {
    private static BufferedReader reader;
    private static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while (! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    }

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

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

    static String nextLine() throws IOException {
        String str = "";
        try {
            str = reader.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }

    static Integer[] nextIntegerArray(int n) throws IOException {
        Integer[] a = new Integer[n];
        for(int i = 0; i < n; i++) a[i] = nextInt();
        return a;
    }

    static int[] nextIntArray(int n) throws IOException {
        int[] a = new int[n];
        for(int i = 0; i < n; i++) a[i] = nextInt();
        return a;
    }

    static char[] nextCharArray() throws IOException {
        return nextLine().toCharArray();
    }
}

class Print {

    private final BufferedWriter bw;
    Print() {
        this.bw=new BufferedWriter(new OutputStreamWriter(System.out));
    }
    void print(Object object)throws IOException {
        bw.append("").append(String.valueOf(object));
    }
    void println(Object object)throws IOException {
        print(object);
        bw.append("\n");
    }
    void close()throws IOException {
        bw.close();
    }
}