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

// ~/BAU/ACM-ICPC/Teams/A++/BlackBurn95
// ~/sudo apt-get Accpeted

import java.io.*;
import java.util.*;
import java.math.*;
import static java.lang.Math.*;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Double.parseDouble;
import static java.lang.String.*;

public class Main {

    static int [] num,seg;
    
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                                              // (new FileReader("input.in"));
        StringBuilder out = new StringBuilder();
        StringTokenizer tk;
        
        tk = new StringTokenizer(in.readLine());
        int n = parseInt(tk.nextToken()),m = parseInt(tk.nextToken());
        
        num = new int[n];
        seg = new int[4*n+1];
        int [][] dp = new int[31][n];
        
        int l,r,q;
        query [] qq = new query[m];
        for(int i=0; i<m; i++) {
            tk = new StringTokenizer(in.readLine());
            l = parseInt(tk.nextToken())-1;
            r = parseInt(tk.nextToken())-1;
            q = parseInt(tk.nextToken());
            
            qq[i] = new query(l,r,q);
            
            for(int j=0; j<31; j++) {
                if((q & (1<<j))!=0) {
                    dp[j][l]++;
                    if(r+1 < n) dp[j][r+1]--;
                }
            }
        }
        
        for(int j=0; j<31; j++)
            for(int i=1; i<n; i++)
                dp[j][i] += dp[j][i-1];
        
        for(int i=0; i<n; i++) {
            for(int j=0; j<31; j++)
                if(dp[j][i] > 0) num[i] |= (1<<j);
        }
        
        build(1,0,n-1);
        
        for(int i=0; i<m; i++) {
            if(get(1,0,n-1,qq[i].l,qq[i].r) != qq[i].q) {
                //System.out.println(qq[i].l+" , "+qq[i].r);
                //System.out.println(get(1,0,n-1,qq[i].l,qq[i].r)+" "+qq[i].q);
                System.out.println("NO");
                return;
            }
        }
                
        out.append("YES\n").append(num[0]);
        for(int i=1; i<n; i++)
            out.append(" ").append(num[i]);
        
        System.out.println(out);
    }
    
    static void build(int p,int s,int e) {
        if(s==e) {
            seg[p] = num[s];
            return;
        }
        
        build(2*p,s,(s+e)/2);
        build(2*p+1,(s+e)/2+1,e);
        
        seg[p] = seg[2*p] & seg[2*p+1];
    }
    
    static int get(int p,int s,int e,int a,int b) {
        if(s>=a && e<=b)
            return seg[p];
        
        if(s>b || e<a) 
            return (int)((1l<<31l)-1);
        
        return get(2*p,s,(s+e)/2,a,b) & get(2*p+1,(s+e)/2+1,e,a,b);
    }
}

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