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.io.*;
import java.util.*;

public class Main{
    final boolean isFileIO =  false;
    BufferedReader in;
    PrintWriter out;
    StringTokenizer st = new StringTokenizer("");
    String delim = " ";

    public static void main(String[] args) throws IOException {
        Main m = new Main();
        m.initIO();
        m.solve();
        m.in.close();
        m.out.close();
    }

    public void initIO() throws IOException {
        if(!isFileIO) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt"); 
        }
    }
  
    String nextToken() throws IOException {
        if(!st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken(delim);
    }
 
    String readLine() throws IOException {
        return in.readLine();
    }

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

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

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

    class Query {
        public int l, r, q;

        public Query(int l, int r, int q) {
            this.l = l;
            this.r = r;
            this.q = q;
        }
    }

    public void solve() throws IOException {
        int n, m;
        n = nextInt(); m = nextInt();
        int[] a = new int[n];
        Query[] queries = new Query[m];
        for(int i = 0; i < m; i++) {
            queries[i] = new Query(nextInt() - 1, nextInt() - 1, nextInt());
        }
        SegmentTree st = new SegmentTree(n);
        for(int i = 0; i < m; i++) {
            int q = queries[i].q;
            st.update(0, 0, st.size - 1, queries[i].l, queries[i].r, q);
        }
        for(int i = 0; i < m; i++) {
            int res = st.get(0, 0, st.size - 1, queries[i].l, queries[i].r);
            int q = queries[i].q;
            int r = queries[i].r;
            int l = queries[i].l;
            if(res != q) {
                out.println("NO");
                return;
            }
        }
        out.println("YES");
        for(int i = 0; i < n; i++) {
            int res = st.get(0, 0, st.size - 1, i, i);
            out.print(res + " ");
        }
        out.println();
    }

    class SegmentTree {
        int[] cur;
        int[] upd;
        public int size = 0;
        public SegmentTree(int n) {
            int z = 0;
            for(int i = 0; i < 31; i++) {
                if((n & (1 << i)) > 0) {
                    z = i;
                }
            }
            size = (1 << (z + 1));
            cur = new int[size * 2 - 1];
            upd = new int[size * 2 - 1];
        }

        public void push(int node) {
            upd[node * 2 + 1] |= upd[node];
            upd[node * 2 + 2] |= upd[node];
            upd[node] = 0;                
        }

        public void update(int node, int fromTree, int toTree, int fromQ, int toQ, int val) {
            if(fromQ > toTree || toQ < fromTree)
                return;

            if(fromTree == fromQ && toTree == toQ) {
                upd[node] |= val;
                return;
            }
            push(node);
            int left = 2 * node + 1;
            int right = 2 * node + 2;
            int mid = fromTree + (toTree - fromTree) / 2;
            update(left, fromTree, mid, fromQ, Math.min(mid, toQ), val);
            update(right, mid + 1, toTree, Math.max(mid + 1, fromQ), toQ, val);
            cur[node] = (cur[left] | upd[left]) & (cur[right] | upd[right]);
        }

        public int get(int node, int fromTree, int toTree, int fromQ, int toQ) {
            if(fromQ > toTree || toQ < fromTree)
                return Integer.MAX_VALUE;

            if(fromTree == fromQ && toTree == toQ) {
                return (cur[node] | upd[node]);
            }
            push(node);
            int mid = fromTree + (toTree - fromTree) / 2;
            int left = 2 * node + 1;
            int right = 2 * node + 2;
            int res = get(left, fromTree, mid, fromQ, Math.min(mid, toQ)) & get(right, mid + 1, toTree, Math.max(mid + 1, fromQ), toQ); 
            int cnt = (toTree - fromTree + 1) / 2;
            cur[node] = (cur[left] | upd[left]) & (cur[right] | upd[right]);
            return res;
        }
    }

}

class Utils {

    public static long binpow(long a, long exp, long mod) {
        if(exp == 0) {
            return 1;
        }
        if(exp % 2 == 0) {
            long temp = binpow(a, exp / 2, mod);
            return (temp * temp) % mod;
        } else {
            return (binpow(a, exp - 1, mod) * a) % mod;
        }
    }

    public static long inv(long a, long mod) {
        return binpow(a, mod - 2, mod);
    }

    public static long addmod(long a, long b, long mod) {
        return (a + b + 2 * mod) % mod;
    }

    public static long gcd(long a, long b) {
        if(b == 0)
            return a;
        return gcd(b, a % b);
    }
}
