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 Codeforces
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        String s[]=bu.readLine().split(" ");
        int n=Integer.parseInt(s[0]),m=Integer.parseInt(s[1]),i,j,c[][]=new int[n+2][30],qr[][]=new int[m][3];
        boolean pos=true;
        for(i=0;i<m;i++)
        {
            s=bu.readLine().split(" ");
            int l=Integer.parseInt(s[0]),r=Integer.parseInt(s[1]),q=Integer.parseInt(s[2]);
            qr[i][0]=l; qr[i][1]=r; qr[i][2]=q;
            for(j=0;j<30;j++)
            if(((q>>j)&1)==1)
            {
                c[l][j]++;
                c[r+1][j]--;
            }
        }

        for(i=1;i<=n;i++)
        for(j=0;j<30;j++)
        c[i][j]+=c[i-1][j];

        for(i=1;i<=n;i++)
        {
            int val=0;
            for(j=0;j<30;j++)
            if(c[i][j]>0) val|=1<<j;
            update(1,1,n,i,i,val);
        }
        for(i=0;i<m;i++)
        {
            long val=query(1,1,n,qr[i][0],qr[i][1]);
            if(val!=qr[i][2]) {pos=false; break;}
        }
        if(!pos) {System.out.print("NO\n"); return;}

        sb.append("YES\n");
        for(i=1;i<=n;i++)
        sb.append(query(1,1,n,i,i)+" ");
        System.out.print(sb);
    }

    static int N=800001;
    static long st[]=new long[N],lazy[]=new long[N];
    static void push(int i)
    {
        if(lazy[i]==0) return;
        st[2*i]=lazy[i];
        st[2*i+1]|=lazy[i];
        lazy[2*i]=lazy[i];
        lazy[2*i+1]=lazy[i];
        lazy[i]=0;
    }

    static void update(int i,int sl,int sr,int l,int r,int v)
    {
        if(sl>r || sr<l) return;
        push(i);
        if(sl==l && sr==r)
        {
            lazy[i]=v;
            st[i]=v;
            return;
        }
        else if(sl>=l && sr<=r)
        {
            lazy[i]=v;
            st[i]|=v;
            return;
        }
        int m=(sl+sr)/2;
        update(2*i,sl,m,l,r,v);
        update(2*i+1,m+1,sr,l,r,v);
        st[i]=(st[2*i]&st[2*i+1]);
    }

    static long query(int i,int sl,int sr,int l,int r)
    {
        if(sl>r || sr<l) return (1L<<40)-1;
        push(i);
        if(sl>=l && sr<=r) return st[i];
        int m=(sl+sr)/2;
        return (query(2*i,sl,m,l,r)&query(2*i+1,m+1,sr,l,r));
    }
}