We'll call an array of n non-negative integers a[1], a[2], ..., a[n] interesting, if it meets m constraints. The i-th of the m constraints consists of three integers li, ri, qi (1 ≤ li ≤ ri ≤ n) meaning that value <image> should be equal to qi. 

Your task is to find any interesting array of n elements or state that such array doesn't exist.

Expression x&y means the bitwise AND of numbers x and y. In programming languages C++, Java and Python this operation is represented as "&", in Pascal — as "and".

Input

The first line contains two integers n, m (1 ≤ n ≤ 105, 1 ≤ m ≤ 105) — the number of elements in the array and the number of limits.

Each of the next m lines contains three integers li, ri, qi (1 ≤ li ≤ ri ≤ n, 0 ≤ qi < 230) describing the i-th limit.

Output

If the interesting array exists, in the first line print "YES" (without the quotes) and in the second line print n integers a[1], a[2], ..., a[n] (0 ≤ a[i] < 230) decribing the interesting array. If there are multiple answers, print any of them.

If the interesting array doesn't exist, print "NO" (without the quotes) in the single line.

Examples

Input

3 1
1 3 3


Output

YES
3 3 3


Input

3 2
1 3 3
1 3 2


Output

NO
import java.util.Scanner;

public class D {
    private Scanner scanner = new Scanner(System.in);
    private final int N = 100000 + 4;
    private final int MAXBIT = 30;
    private int[] l = new int[N], r = new int[N], q = new int[N], a = new int[N], t = new int[N << 2];
    private int n, m;

    public void readData() {
        n = scanner.nextInt();
        m = scanner.nextInt();
        for (int i = 0; i < m; i++) {
            l[i] = scanner.nextInt() - 1;
            r[i] = scanner.nextInt();
            q[i] = scanner.nextInt();
        }

        int[] sum = new int[N];
        for (int i = 0; i < MAXBIT; i++) {
            for (int j = 0; j < n; j++)
                sum[j] = 0;
            for (int j = 0; j < m; j++) {
                if ((q[j] & (1 << i)) != 0 ) {
                    sum[l[j]]++;
                    sum[r[j]]--;
                }
            }
            for (int j = 0; j < n; j++) {
                if (j > 0)
                    sum[j] += sum[j - 1];
                if (sum[j] > 0)
                    a[j] |= 1 << i;
            }
        }
        buildTree(0, 0, n);
    }

    private void buildTree(int node, int left, int right) {
        if (left + 1 == right) {
            t[node] = a[left];
            return;
        }

        int mid = ((left + right) >> 1);
        buildTree(node * 2 + 1, left, mid);
        buildTree(node * 2 + 2, mid, right);
        t[node] = t[node * 2 + 1] & t[node * 2 + 2];
    }

    private int query(int node, int l, int r, int L, int R) {
        if (l == L && r == R)
            return t[node];
        int mid = ((L + R) >> 1);
        int ans = (1 << MAXBIT) - 1;
        if (l < mid)
            ans &= query(node * 2 + 1, l, Math.min(mid, r), L, mid);
        if (r > mid)
            ans &= query(node * 2 + 2, Math.max(mid, l), r, mid, R);
        return ans;
    }

    public boolean check() {
        for (int i = 0; i < m; i++) {
            if (query(0, l[i], r[i], 0, n) != q[i])
                return false;
        }
        return true;
    }

    public void print() {
        System.out.print(a[0]);
        for (int i = 1; i < n; i++)
            System.out.print(" " + a[i]);
        System.out.println();
    }

    public static void main(String[] args) {
        D tree = new D();
        tree.readData();
        if(tree.check()) {
            System.out.println("YES");
            tree.print();
        } else
            System.out.println("NO");
    }
}