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.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Scanner;

public class ProbA {
    public static int a[][];
    public static int b[][];
    public static int l[], r[], gt[];
    public static int getbit(int x, int i)
    {
        return (x >> i) & 1;
    }
    public static int mul(int x)
    {
        int res = 0;
        for(int i = 29; i >= 0; i--)
            if(a[x][i] > 0)
                res = (res << 1) | 1;
            else res = (res << 1);
        return res;
    }
    public static void main(String args[])
    {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = in.readInt();
        a = new int[n][30];
        b = new int[n][30];
        for(int i = 0; i < n; i++)
            for(int j = 0; j < 30; j++)
                a[i][j] = 0;
        int m = in.readInt();
        l = new int [m];
        r = new int[m];
        gt = new int [m];
        for(int i = 0; i < m; i++)
        {
            l[i] = in.readInt() - 1;
            r[i] = in.readInt() - 1;
            gt[i] = in.readInt();
            for(int j = 0; j < 30; j++)
                if(getbit(gt[i], j) == 1)
                {
                    a[l[i]][j]++;
                    if(r[i] + 1 < n)
                        a[r[i] + 1][j]--;
                }   
        }
        for(int j = 0; j < 30; j++)
            if(a[0][j] == 0)
                b[0][j] = 1;
            else b[0][j] = 0;
        for(int i = 1; i < n; i++)
            for(int j = 0; j < 30; j++)
            {
                a[i][j] += a[i - 1][j];
                if(a[i][j] == 0)
                    b[i][j] = b[i - 1][j] + 1;
                else b[i][j] = b[i - 1][j];
            }
            
        for(int i = 0; i < m; i++)
        {
            for(int j = 0; j < 30; j++)
                if(getbit(gt[i], j) == 0)
                {
                    if(l[i] == 0 && b[r[i]][j] == 0)
                    {
                        out.print("NO");
                        out.flush();
                        out.close();
                        return;
                    }
                    if(l[i] > 0 && b[r[i]][j] - b[l[i]-1][j] == 0)
                    {
                        out.print("NO");
                        out.flush();
                        out.close();
                        return;
                    }
                }
        }
        out.print("YES\n");
        for(int i = 0; i < n; i++)
            out.print("" + mul(i) + " ");
        out.flush();
        out.close();
    }
    
}
class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1000];
    private int curChar, numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    private int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    private boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuffer buf = new StringBuffer();
        int c = read();
        while (c != '\n' && c != -1) {
            buf.appendCodePoint(c);
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines)
            return readLine();
        else
            return readLine0();
    }

    public char readCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }
}
