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 {
	static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
	static int n,m,ju,a;
	static Pair[] aa=new Pair[100005];
	static int[][] sum=new int[40][100005];
	static int[][] mm=new int[40][100005];
	static class Pair implements Comparable<Pair>
	{
		int x,y,z;
		Pair(int a,int b,int c)
		{
			x=a;y=b;z=c;
		}
		public int compareTo(Pair p) {
			return x-p.x;
		}
	}

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		n=in.nextInt();m=in.nextInt();
		for(int i=1;i<=m;i++)
			aa[i]=new Pair(in.nextInt(),in.nextInt(),in.nextInt());
		Arrays.sort(aa,1,m+1);
		for(int j=0;j<30;j++)
		{
			a=0;
			for(int i=1;i<=m;i++)
			{
				if(((1<<j)&aa[i].z)==0) continue;
				a=Math.max(a,aa[i].x);
				while(a<=aa[i].y) mm[j][a++]=1;
			}
			for(int i=1;i<=n;i++)
				sum[j][i]=sum[j][i-1]+mm[j][i];
		}
		ju=1;
		for(int i=1;i<=m;i++)
		{
			for(int j=0;j<30;j++)
			{
				if(((1<<j)&aa[i].z)>0) continue;
				a=sum[j][aa[i].y]-sum[j][aa[i].x-1];
				if(a>=aa[i].y-aa[i].x+1) ju=0;
			}
		}
		out.println(ju==0?"NO":"YES");
		if(ju==1)
		{
			for(int i=1;i<=n;i++)
			{
				a=0;
				for(int j=0;j<30;j++)
					a+=mm[j][i]<<j;
				out.print(a+" ");
			}
		}
		out.flush();
	}
}
