using System;
using System.Collections.Generic;
using System.Linq;
using Solver.Ex;
using Debug = System.Diagnostics.Debug;
using Watch = System.Diagnostics.Stopwatch;
using StringBuilder = System.Text.StringBuilder;
namespace Solver
{
    public class Solver
    {
        public void Solve()
        {
            var n = sc.Integer();
            var k = sc.Integer();
            var tree = new SegmentTree(n);
            var x = new int[k];
            var y = new int[k];
            var z = new int[k];
            for (int i = 0; i < k; i++)
            {
                var l = sc.Integer();
                var r = sc.Integer();
                var v = sc.Integer();
                x[i] = l;
                y[i] = r;
                z[i] = v;
                tree.Update(l - 1, r, v);
            }
            for (int i = 0; i < k; i++)
            {
                var l = x[i];
                var r = y[i];
                var v = z[i];
                var p = tree[l - 1, r];
                if (p != v)
                {
                    IO.Printer.Out.WriteLine("NO");
                    return;
                }

            }

            var a = new List<int>();
            for (int i = 1; i <= n; i++)
            {
                var v = tree[i - 1];
                if (v == -1)
                    a.Add((1 << 30) - 1);
                else a.Add(v);
            }
            IO.Printer.Out.WriteLine("YES");
            IO.Printer.Out.WriteLine(a.AsJoinedString());

        }

        internal IO.StreamScanner sc;
    }

    #region Main and Settings
    static class Program
    {
        static void Main(string[] arg)
        {
#if DEBUG
            var errStream = new System.IO.FileStream(@"..\..\dbg.out", System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);
            Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(errStream, "debugStream"));
            Debug.AutoFlush = false;
            var sw = new Watch(); sw.Start();
            try
            {
#endif
                var solver = new Solver();
                solver.sc = new IO.StreamScanner(Console.OpenStandardInput());
                solver.Solve();
                IO.Printer.Out.Flush();
#if DEBUG
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex.Message);
                Console.Error.WriteLine(ex.StackTrace);
            }
            finally
            {
                sw.Stop();
                Console.ForegroundColor = ConsoleColor.Green;
                Console.Error.WriteLine("Time:{0}ms", sw.ElapsedMilliseconds);
                Debug.Close();
                System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
            }
#endif
        }

    }
    #endregion
}
#region IO Helper
namespace Solver.IO
{
    public class Printer : System.IO.StreamWriter
    {
        static Printer() { Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; }
        public static Printer Out { get; set; }
        public override IFormatProvider FormatProvider { get { return System.Globalization.CultureInfo.InvariantCulture; } }
        public Printer(System.IO.Stream stream) : base(stream, new System.Text.UTF8Encoding(false, true)) { }
        public Printer(System.IO.Stream stream, System.Text.Encoding encoding) : base(stream, encoding) { }
        public void Write<T>(string format, IEnumerable<T> source) { Write(format, source.OfType<object>().ToArray()); }
        public void WriteLine<T>(string format, IEnumerable<T> source) { WriteLine(format, source.OfType<object>().ToArray()); }
    }
    public class StreamScanner
    {
        public StreamScanner(System.IO.Stream stream) { iStream = stream; }
        private readonly System.IO.Stream iStream;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        private bool eof = false;
        public bool IsEndOfStream { get { return eof; } }
        const byte lb = 33, ub = 126, el = 10, cr = 13;
        public byte read()
        {
            if (eof) throw new System.IO.EndOfStreamException();
            if (ptr >= len) { ptr = 0; if ((len = iStream.Read(buf, 0, 1024)) <= 0) { eof = true; return 0; } }
            return buf[ptr++];
        }
        public char Char() { byte b = 0; do b = read(); while (b < lb || ub < b);            return (char)b; }
        public char[] Char(int n) { var a = new char[n]; for (int i = 0; i < n; i++) a[i] = Char(); return a; }
        public char[][] Char(int n, int m) { var a = new char[n][]; for (int i = 0; i < n; i++) a[i] = Char(m); return a; }
        public string Scan()
        {
            if (eof) throw new System.IO.EndOfStreamException();
            StringBuilder sb = null;
            var enc = System.Text.UTF8Encoding.Default;
            do
            {
                for (; ptr < len && (buf[ptr] < lb || ub < buf[ptr]); ptr++) ;
                if (ptr < len) break;
                ptr = 0;
                if ((len = iStream.Read(buf, 0, 1024)) <= 0) { eof = true; return ""; }
            } while (true);
            do
            {
                var f = ptr;
                for (; ptr < len; ptr++)
                    if (buf[ptr] < lb || ub < buf[ptr])
                    //if(buf[i]==cr||buf[i]==el)
                    {
                        string s;
                        if (sb == null) s = enc.GetString(buf, f, ptr - f);
                        else { sb.Append(enc.GetChars(buf, f, ptr - f)); s = sb.ToString(); }
                        ptr++; return s;
                    }
                if (sb == null) sb = new StringBuilder(enc.GetString(buf, f, len - f));
                else sb.Append(enc.GetChars(buf, ptr, len - ptr));
                ptr = 0;

            }
            while (!eof && (len = iStream.Read(buf, 0, 1024)) > 0);
            eof = true; return (sb != null) ? sb.ToString() : "";
        }
        public long Long()
        {
            long ret = 0; byte b = 0; bool isMynus = false;
            const byte zr = 48, nn = 57, my = 45;
            do b = read();
            while (b != my && (b < zr || nn < b));
            if (b == my) { isMynus = true; b = read(); }
            for (; true; b = read())
                if (b < zr || nn < b)
                    return isMynus ? -ret : ret;
                else ret = ret * 10 + b - zr;
        }
        public int Integer()
        {
            int ret = 0; byte b = 0; bool isMynus = false;
            const byte zr = 48, nn = 57, my = 45;
            do b = read();
            while (b != my && (b < zr || nn < b));
            if (b == my) { isMynus = true; b = read(); }
            for (; true; b = read())
                if (b < zr || nn < b)
                    return isMynus ? -ret : ret;
                else ret = ret * 10 + b - zr;
        }
        public double Double() { return double.Parse(Scan(), System.Globalization.CultureInfo.InvariantCulture); }
        public string[] Scan(int n) { var a = new string[n]; for (int i = 0; i < n; i++) a[i] = Scan(); return a; }
        public double[] Double(int n) { var a = new double[n]; for (int i = 0; i < n; i++) a[i] = Double(); return a; }
        public int[] Integer(int n) { var a = new int[n]; for (int i = 0; i < n; i++) a[i] = Integer(); return a; }
        public long[] Long(int n) { var a = new long[n]; for (int i = 0; i < n; i++)a[i] = Long(); return a; }
        public void Flush() { iStream.Flush(); }
    }
}
#endregion
#region Extension
namespace Solver.Ex
{
    static public partial class EnumerableEx
    {
        static public string AsString(this IEnumerable<char> ie) { return new string(ie.ToArray()); }
        static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") { return string.Join(st, ie); }
        static public T[] Enumerate<T>(this int n, Func<int, T> f) { var a = new T[n]; for (int i = 0; i < n; i++) a[i] = f(i); return a; }
    }
}
#endregion

#region SegTree
[System.Diagnostics.DebuggerDisplay("Data={ToString()}")]
public class SegmentTree
{
    const int Max = (1 << 30) - 1;
    int n;
    int[] data;
    public SegmentTree(int size)
    {
        n = 1;
        while (n < size)
            n <<= 1;
        data = new int[n << 1];
        for (int i = 0; i < data.Length; i++)
            data[i] = -1;
    }

    ///Data[i]>
    public int this[int i] { get { return data[i + n]; } }
    ///Minimum[a,b)>
    public int this[int l, int r] { get { return Query(l, r, 1, 0, n); } }
    // turn kth index value into v
    public void Update(int a, int b, int v)
    {
        Update(a, b, v, 1, 0, n);
    }
    public void Update(int a, int b, int v, int k, int l, int r)
    {
        if (k >= data.Length)
            return;
        if (r <= a || b <= l)
            return;
        if (a <= l && r <= b)
        {
            if (data[k] != -1)
                data[k] |= v;
            else
                data[k] = v;
            Update(a, b, v, k << 1, l, (l + r) >> 1);
            Update(a, b, v, (k << 1) + 1, (l + r) >> 1, r);

        }
        else
        {
            Update(a, b, v, k << 1, l, (l + r) >> 1);
            Update(a, b, v, (k << 1) + 1, (l + r) >> 1, r);
        }
    }
    private int Query(int a, int b, int k, int l, int r)
    {
        if (r <= a || b <= l)
            return Max;
        if (a <= l && r <= b)
            if (data[k] != -1)
                return data[k];
            else return Max;
        else
        {
            var vl = Query(a, b, k << 1, l, (l + r) >> 1);
            var vr = Query(a, b, (k << 1) + 1, (l + r) >> 1, r);
            return vl & vr;
        }
    }
    public override string ToString()
    {
        return string.Join(",", Enumerable.Range(0, n).Select(i => this[i]).Where(v => v != Max));
    }
    public string Visualize()
    {
        var sb = new System.Text.StringBuilder();
        var k = 2;
        var len = n << 1;
        for (int i = 1; i < len; i++)
        {
            if (data[i] != Max) sb.Append(data[i]);
            else sb.Append('-');
            if (i < k - 1) sb.Append(',');
            else if (i < len - 1)
            {
                sb.AppendLine();
                k <<= 1;
            }
        }
        return sb.ToString();

    }
}
#endregion


using System;
using System.Collections.Generic;
using System.Linq;
using Solver.Ex;
using Debug = System.Diagnostics.Debug;
using Watch = System.Diagnostics.Stopwatch;
using StringBuilder = System.Text.StringBuilder;
namespace Solver
{
    public class Solver
    {
        public void Solve()
        {
            var n = sc.Integer();
            var m = sc.Integer();
            var cum = new int[30, n + 50];
            var q = new int[m][];
            for (int i = 0; i < m; i++)
                q[i] = sc.Integer(3);
            for (int i = 0; i < m; i++)
            {
                var l = q[i][0];
                var r = q[i][1] + 1;
                var v = q[i][2];
                for (int j = 0; j < 30; j++)
                    if (((v >> j) & 1) == 1)
                    {
                        cum[j, l]++;
                        cum[j, r]--;
                    }

            }
            for (int i = 0; i < n; i++)
                for (int j = 0; j < 30; j++)
                    if (cum[j, i] > 0)
                        cum[j, i] = 1;
            var a = new int[n];
            for (int j = 0; j < 30; j++)
                for (int i = 1; i <= n; i++)
                    cum[j, i] = cum[j, i] + cum[j, i - 1];
            for (int i = 1; i <= n; i++)
                for (int j = 0; j < 30; j++)
                    if (cum[j, i] > 0)
                        a[i - 1] += (1 << j);

            for (int j = 0; j < 30; j++)
                for (int i = 1; i <= n; i++)
                    cum[j, i] += cum[j, i - 1];
            for (int i = 0; i < m; i++)
            {
                var l = q[i][0] - 1;
                var r = q[i][1];
                var v = q[i][2];
                for (int j = 0; j < 30; j++)
                {
                    var t = cum[j, r] - cum[j, l];
                    if (((v >> j) & 1) == 1)
                    {

                        if (t < r - l)
                        {
                            IO.Printer.Out.WriteLine("NO");
                            return;
                        }
                    }
                    else
                    {
                        if (t ==r-l)
                        {
                            IO.Printer.Out.WriteLine("NO");
                            return;
                        }
                    }
                }
            }
            IO.Printer.Out.WriteLine("YES");
            IO.Printer.Out.WriteLine(a.AsJoinedString());

        }

        internal IO.StreamScanner sc;
    }

    #region Main and Settings
    static class Program
    {
        static void Main(string[] arg)
        {
#if DEBUG
            var errStream = new System.IO.FileStream(@"..\..\dbg.out", System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);
            Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(errStream, "debugStream"));
            Debug.AutoFlush = false;
            var sw = new Watch(); sw.Start();
            try
            {
#endif
                var solver = new Solver();
                solver.sc = new IO.StreamScanner(Console.OpenStandardInput());
                solver.Solve();
                IO.Printer.Out.Flush();
#if DEBUG
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex.Message);
                Console.Error.WriteLine(ex.StackTrace);
            }
            finally
            {
                sw.Stop();
                Console.ForegroundColor = ConsoleColor.Green;
                Console.Error.WriteLine("Time:{0}ms", sw.ElapsedMilliseconds);
                Debug.Close();
                System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
            }
#endif
        }

    }
    #endregion
}
#region IO Helper
namespace Solver.IO
{
    public class Printer : System.IO.StreamWriter
    {
        static Printer() { Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; }
        public static Printer Out { get; set; }
        public override IFormatProvider FormatProvider { get { return System.Globalization.CultureInfo.InvariantCulture; } }
        public Printer(System.IO.Stream stream) : base(stream, new System.Text.UTF8Encoding(false, true)) { }
        public Printer(System.IO.Stream stream, System.Text.Encoding encoding) : base(stream, encoding) { }
        public void Write<T>(string format, IEnumerable<T> source) { Write(format, source.OfType<object>().ToArray()); }
        public void WriteLine<T>(string format, IEnumerable<T> source) { WriteLine(format, source.OfType<object>().ToArray()); }
    }
    public class StreamScanner
    {
        public StreamScanner(System.IO.Stream stream) { iStream = stream; }
        private readonly System.IO.Stream iStream;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        private bool eof = false;
        public bool IsEndOfStream { get { return eof; } }
        const byte lb = 33, ub = 126, el = 10, cr = 13;
        public byte read()
        {
            if (eof) throw new System.IO.EndOfStreamException();
            if (ptr >= len) { ptr = 0; if ((len = iStream.Read(buf, 0, 1024)) <= 0) { eof = true; return 0; } }
            return buf[ptr++];
        }
        public char Char() { byte b = 0; do b = read(); while (b < lb || ub < b);            return (char)b; }
        public char[] Char(int n) { var a = new char[n]; for (int i = 0; i < n; i++) a[i] = Char(); return a; }
        public char[][] Char(int n, int m) { var a = new char[n][]; for (int i = 0; i < n; i++) a[i] = Char(m); return a; }
        public string Scan()
        {
            if (eof) throw new System.IO.EndOfStreamException();
            StringBuilder sb = null;
            var enc = System.Text.UTF8Encoding.Default;
            do
            {
                for (; ptr < len && (buf[ptr] < lb || ub < buf[ptr]); ptr++) ;
                if (ptr < len) break;
                ptr = 0;
                if ((len = iStream.Read(buf, 0, 1024)) <= 0) { eof = true; return ""; }
            } while (true);
            do
            {
                var f = ptr;
                for (; ptr < len; ptr++)
                    if (buf[ptr] < lb || ub < buf[ptr])
                    //if(buf[i]==cr||buf[i]==el)
                    {
                        string s;
                        if (sb == null) s = enc.GetString(buf, f, ptr - f);
                        else { sb.Append(enc.GetChars(buf, f, ptr - f)); s = sb.ToString(); }
                        ptr++; return s;
                    }
                if (sb == null) sb = new StringBuilder(enc.GetString(buf, f, len - f));
                else sb.Append(enc.GetChars(buf, ptr, len - ptr));
                ptr = 0;

            }
            while (!eof && (len = iStream.Read(buf, 0, 1024)) > 0);
            eof = true; return (sb != null) ? sb.ToString() : "";
        }
        public long Long()
        {
            long ret = 0; byte b = 0; bool isMynus = false;
            const byte zr = 48, nn = 57, my = 45;
            do b = read();
            while (b != my && (b < zr || nn < b));
            if (b == my) { isMynus = true; b = read(); }
            for (; true; b = read())
                if (b < zr || nn < b)
                    return isMynus ? -ret : ret;
                else ret = ret * 10 + b - zr;
        }
        public int Integer()
        {
            int ret = 0; byte b = 0; bool isMynus = false;
            const byte zr = 48, nn = 57, my = 45;
            do b = read();
            while (b != my && (b < zr || nn < b));
            if (b == my) { isMynus = true; b = read(); }
            for (; true; b = read())
                if (b < zr || nn < b)
                    return isMynus ? -ret : ret;
                else ret = ret * 10 + b - zr;
        }
        public double Double() { return double.Parse(Scan(), System.Globalization.CultureInfo.InvariantCulture); }
        public string[] Scan(int n) { var a = new string[n]; for (int i = 0; i < n; i++) a[i] = Scan(); return a; }
        public double[] Double(int n) { var a = new double[n]; for (int i = 0; i < n; i++) a[i] = Double(); return a; }
        public int[] Integer(int n) { var a = new int[n]; for (int i = 0; i < n; i++) a[i] = Integer(); return a; }
        public long[] Long(int n) { var a = new long[n]; for (int i = 0; i < n; i++)a[i] = Long(); return a; }
        public void Flush() { iStream.Flush(); }
    }
}
#endregion
#region Extension
namespace Solver.Ex
{
    static public partial class EnumerableEx
    {
        static public string AsString(this IEnumerable<char> ie) { return new string(ie.ToArray()); }
        static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") { return string.Join(st, ie); }
        static public T[] Enumerate<T>(this int n, Func<int, T> f) { var a = new T[n]; for (int i = 0; i < n; i++) a[i] = f(i); return a; }
    }
}
#endregion


using System;
using System.Collections.Generic;
using System.Linq;
using Solver.Ex;
using Debug = System.Diagnostics.Debug;
using Watch = System.Diagnostics.Stopwatch;
using StringBuilder = System.Text.StringBuilder;
namespace Solver
{
    public class Solver
    {
        public void Solve()
        {
            var n = sc.Integer();
            var m = sc.Integer();
            var cum = new int[30, n + 50];
            var q = new int[m][];
            for (int i = 0; i < m; i++)
                q[i] = sc.Integer(3);
            for (int i = 0; i < m; i++)
            {
                var l = q[i][0];
                var r = q[i][1] + 1;
                var v = q[i][2];
                for (int j = 0; j < 30; j++)
                    if (((v >> j) & 1) == 1)
                    {
                        cum[j, l]++;
                        cum[j, r]--;
                    }

            }
            for (int j = 0; j < 30; j++)
                for (int i = 1; i <= n; i++)
                    cum[j, i] = cum[j, i] + cum[j, i - 1];
            for (int i = 0; i < n; i++)
                for (int j = 0; j < 30; j++)
                    if (cum[j, i] > 0)
                        cum[j, i] = 1;
            var a = new int[n];
            for (int i = 1; i <= n; i++)
                for (int j = 0; j < 30; j++)
                    if (cum[j, i] > 0)
                        a[i - 1] |= (1 << j);

            for (int j = 0; j < 30; j++)
                for (int i = 1; i <= n; i++)
                    cum[j, i] += cum[j, i - 1];
            for (int i = 0; i < m; i++)
            {
                var l = q[i][0] - 1;
                var r = q[i][1];
                var v = q[i][2];
                for (int j = 0; j < 30; j++)
                {
                    var t = cum[j, r] - cum[j, l];
                    if (((v >> j) & 1) == 0)
                    {
                        if (t == r - l)
                        {
                            IO.Printer.Out.WriteLine("NO");
                            return;
                        }
                    }
                }
            }
            IO.Printer.Out.WriteLine("YES");
            IO.Printer.Out.WriteLine(a.AsJoinedString());

        }

        internal IO.StreamScanner sc;
    }

    #region Main and Settings
    static class Program
    {
        static void Main(string[] arg)
        {
#if DEBUG
            var errStream = new System.IO.FileStream(@"..\..\dbg.out", System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);
            Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(errStream, "debugStream"));
            Debug.AutoFlush = false;
            var sw = new Watch(); sw.Start();
            try
            {
#endif
                var solver = new Solver();
                solver.sc = new IO.StreamScanner(Console.OpenStandardInput());
                solver.Solve();
                IO.Printer.Out.Flush();
#if DEBUG
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex.Message);
                Console.Error.WriteLine(ex.StackTrace);
            }
            finally
            {
                sw.Stop();
                Console.ForegroundColor = ConsoleColor.Green;
                Console.Error.WriteLine("Time:{0}ms", sw.ElapsedMilliseconds);
                Debug.Close();
                System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
            }
#endif
        }

    }
    #endregion
}
#region IO Helper
namespace Solver.IO
{
    public class Printer : System.IO.StreamWriter
    {
        static Printer() { Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; }
        public static Printer Out { get; set; }
        public override IFormatProvider FormatProvider { get { return System.Globalization.CultureInfo.InvariantCulture; } }
        public Printer(System.IO.Stream stream) : base(stream, new System.Text.UTF8Encoding(false, true)) { }
        public Printer(System.IO.Stream stream, System.Text.Encoding encoding) : base(stream, encoding) { }
        public void Write<T>(string format, IEnumerable<T> source) { Write(format, source.OfType<object>().ToArray()); }
        public void WriteLine<T>(string format, IEnumerable<T> source) { WriteLine(format, source.OfType<object>().ToArray()); }
    }
    public class StreamScanner
    {
        public StreamScanner(System.IO.Stream stream) { iStream = stream; }
        private readonly System.IO.Stream iStream;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        private bool eof = false;
        public bool IsEndOfStream { get { return eof; } }
        const byte lb = 33, ub = 126, el = 10, cr = 13;
        public byte read()
        {
            if (eof) throw new System.IO.EndOfStreamException();
            if (ptr >= len) { ptr = 0; if ((len = iStream.Read(buf, 0, 1024)) <= 0) { eof = true; return 0; } }
            return buf[ptr++];
        }
        public char Char() { byte b = 0; do b = read(); while (b < lb || ub < b);            return (char)b; }
        public char[] Char(int n) { var a = new char[n]; for (int i = 0; i < n; i++) a[i] = Char(); return a; }
        public char[][] Char(int n, int m) { var a = new char[n][]; for (int i = 0; i < n; i++) a[i] = Char(m); return a; }
        public string Scan()
        {
            if (eof) throw new System.IO.EndOfStreamException();
            StringBuilder sb = null;
            var enc = System.Text.UTF8Encoding.Default;
            do
            {
                for (; ptr < len && (buf[ptr] < lb || ub < buf[ptr]); ptr++) ;
                if (ptr < len) break;
                ptr = 0;
                if ((len = iStream.Read(buf, 0, 1024)) <= 0) { eof = true; return ""; }
            } while (true);
            do
            {
                var f = ptr;
                for (; ptr < len; ptr++)
                    if (buf[ptr] < lb || ub < buf[ptr])
                    //if(buf[i]==cr||buf[i]==el)
                    {
                        string s;
                        if (sb == null) s = enc.GetString(buf, f, ptr - f);
                        else { sb.Append(enc.GetChars(buf, f, ptr - f)); s = sb.ToString(); }
                        ptr++; return s;
                    }
                if (sb == null) sb = new StringBuilder(enc.GetString(buf, f, len - f));
                else sb.Append(enc.GetChars(buf, ptr, len - ptr));
                ptr = 0;

            }
            while (!eof && (len = iStream.Read(buf, 0, 1024)) > 0);
            eof = true; return (sb != null) ? sb.ToString() : "";
        }
        public long Long()
        {
            long ret = 0; byte b = 0; bool isMynus = false;
            const byte zr = 48, nn = 57, my = 45;
            do b = read();
            while (b != my && (b < zr || nn < b));
            if (b == my) { isMynus = true; b = read(); }
            for (; true; b = read())
                if (b < zr || nn < b)
                    return isMynus ? -ret : ret;
                else ret = ret * 10 + b - zr;
        }
        public int Integer()
        {
            int ret = 0; byte b = 0; bool isMynus = false;
            const byte zr = 48, nn = 57, my = 45;
            do b = read();
            while (b != my && (b < zr || nn < b));
            if (b == my) { isMynus = true; b = read(); }
            for (; true; b = read())
                if (b < zr || nn < b)
                    return isMynus ? -ret : ret;
                else ret = ret * 10 + b - zr;
        }
        public double Double() { return double.Parse(Scan(), System.Globalization.CultureInfo.InvariantCulture); }
        public string[] Scan(int n) { var a = new string[n]; for (int i = 0; i < n; i++) a[i] = Scan(); return a; }
        public double[] Double(int n) { var a = new double[n]; for (int i = 0; i < n; i++) a[i] = Double(); return a; }
        public int[] Integer(int n) { var a = new int[n]; for (int i = 0; i < n; i++) a[i] = Integer(); return a; }
        public long[] Long(int n) { var a = new long[n]; for (int i = 0; i < n; i++)a[i] = Long(); return a; }
        public void Flush() { iStream.Flush(); }
    }
}
#endregion
#region Extension
namespace Solver.Ex
{
    static public partial class EnumerableEx
    {
        static public string AsString(this IEnumerable<char> ie) { return new string(ie.ToArray()); }
        static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") { return string.Join(st, ie); }
        static public T[] Enumerate<T>(this int n, Func<int, T> f) { var a = new T[n]; for (int i = 0; i < n; i++) a[i] = f(i); return a; }
    }
}
#endregion


using System;
using System.Collections.Generic;
using System.Linq;
using Solver.Ex;
using Debug = System.Diagnostics.Debug;
using Watch = System.Diagnostics.Stopwatch;
using StringBuilder = System.Text.StringBuilder;
namespace Solver
{
    public class Solver
    {
        public void Solve()
        {
            var n = sc.Integer();
            var k = sc.Integer();
            var tree = new SegmentTree(n);
            var x = new int[k];
            var y = new int[k];
            var z = new int[k];
            for (int i = 0; i < k; i++)
            {
                var l = sc.Integer();
                var r = sc.Integer();
                var v = sc.Integer();
                x[i] = l;
                y[i] = r;
                z[i] = v;
                tree.Update(l - 1, r, v);
            }
            for (int i = 0; i < k; i++)
            {
                var l = x[i];
                var r = y[i];
                var v = z[i];
                var p = tree[l - 1, r];
                if (p != v)
                {
                    IO.Printer.Out.WriteLine("NO");
                    return;
                }

            }
            var a = new List<int>();
            for (int i = 1; i <= n; i++)
            {
                var v = tree[i - 1];
                if (v == -1)
                    a.Add((1 << 30) - 1);
                else a.Add(v);
            }
            IO.Printer.Out.WriteLine(a.AsJoinedString());

        }

        internal IO.StreamScanner sc;
    }

    #region Main and Settings
    static class Program
    {
        static void Main(string[] arg)
        {
#if DEBUG
            var errStream = new System.IO.FileStream(@"..\..\dbg.out", System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);
            Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(errStream, "debugStream"));
            Debug.AutoFlush = false;
            var sw = new Watch(); sw.Start();
            try
            {
#endif
                var solver = new Solver();
                solver.sc = new IO.StreamScanner(Console.OpenStandardInput());
                solver.Solve();
                IO.Printer.Out.Flush();
#if DEBUG
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex.Message);
                Console.Error.WriteLine(ex.StackTrace);
            }
            finally
            {
                sw.Stop();
                Console.ForegroundColor = ConsoleColor.Green;
                Console.Error.WriteLine("Time:{0}ms", sw.ElapsedMilliseconds);
                Debug.Close();
                System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
            }
#endif
        }

    }
    #endregion
}
#region IO Helper
namespace Solver.IO
{
    public class Printer : System.IO.StreamWriter
    {
        static Printer() { Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; }
        public static Printer Out { get; set; }
        public override IFormatProvider FormatProvider { get { return System.Globalization.CultureInfo.InvariantCulture; } }
        public Printer(System.IO.Stream stream) : base(stream, new System.Text.UTF8Encoding(false, true)) { }
        public Printer(System.IO.Stream stream, System.Text.Encoding encoding) : base(stream, encoding) { }
        public void Write<T>(string format, IEnumerable<T> source) { Write(format, source.OfType<object>().ToArray()); }
        public void WriteLine<T>(string format, IEnumerable<T> source) { WriteLine(format, source.OfType<object>().ToArray()); }
    }
    public class StreamScanner
    {
        public StreamScanner(System.IO.Stream stream) { iStream = stream; }
        private readonly System.IO.Stream iStream;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        private bool eof = false;
        public bool IsEndOfStream { get { return eof; } }
        const byte lb = 33, ub = 126, el = 10, cr = 13;
        public byte read()
        {
            if (eof) throw new System.IO.EndOfStreamException();
            if (ptr >= len) { ptr = 0; if ((len = iStream.Read(buf, 0, 1024)) <= 0) { eof = true; return 0; } }
            return buf[ptr++];
        }
        public char Char() { byte b = 0; do b = read(); while (b < lb || ub < b);            return (char)b; }
        public char[] Char(int n) { var a = new char[n]; for (int i = 0; i < n; i++) a[i] = Char(); return a; }
        public char[][] Char(int n, int m) { var a = new char[n][]; for (int i = 0; i < n; i++) a[i] = Char(m); return a; }
        public string Scan()
        {
            if (eof) throw new System.IO.EndOfStreamException();
            StringBuilder sb = null;
            var enc = System.Text.UTF8Encoding.Default;
            do
            {
                for (; ptr < len && (buf[ptr] < lb || ub < buf[ptr]); ptr++) ;
                if (ptr < len) break;
                ptr = 0;
                if ((len = iStream.Read(buf, 0, 1024)) <= 0) { eof = true; return ""; }
            } while (true);
            do
            {
                var f = ptr;
                for (; ptr < len; ptr++)
                    if (buf[ptr] < lb || ub < buf[ptr])
                    //if(buf[i]==cr||buf[i]==el)
                    {
                        string s;
                        if (sb == null) s = enc.GetString(buf, f, ptr - f);
                        else { sb.Append(enc.GetChars(buf, f, ptr - f)); s = sb.ToString(); }
                        ptr++; return s;
                    }
                if (sb == null) sb = new StringBuilder(enc.GetString(buf, f, len - f));
                else sb.Append(enc.GetChars(buf, ptr, len - ptr));
                ptr = 0;

            }
            while (!eof && (len = iStream.Read(buf, 0, 1024)) > 0);
            eof = true; return (sb != null) ? sb.ToString() : "";
        }
        public long Long()
        {
            long ret = 0; byte b = 0; bool isMynus = false;
            const byte zr = 48, nn = 57, my = 45;
            do b = read();
            while (b != my && (b < zr || nn < b));
            if (b == my) { isMynus = true; b = read(); }
            for (; true; b = read())
                if (b < zr || nn < b)
                    return isMynus ? -ret : ret;
                else ret = ret * 10 + b - zr;
        }
        public int Integer()
        {
            int ret = 0; byte b = 0; bool isMynus = false;
            const byte zr = 48, nn = 57, my = 45;
            do b = read();
            while (b != my && (b < zr || nn < b));
            if (b == my) { isMynus = true; b = read(); }
            for (; true; b = read())
                if (b < zr || nn < b)
                    return isMynus ? -ret : ret;
                else ret = ret * 10 + b - zr;
        }
        public double Double() { return double.Parse(Scan(), System.Globalization.CultureInfo.InvariantCulture); }
        public string[] Scan(int n) { var a = new string[n]; for (int i = 0; i < n; i++) a[i] = Scan(); return a; }
        public double[] Double(int n) { var a = new double[n]; for (int i = 0; i < n; i++) a[i] = Double(); return a; }
        public int[] Integer(int n) { var a = new int[n]; for (int i = 0; i < n; i++) a[i] = Integer(); return a; }
        public long[] Long(int n) { var a = new long[n]; for (int i = 0; i < n; i++)a[i] = Long(); return a; }
        public void Flush() { iStream.Flush(); }
    }
}
#endregion
#region Extension
namespace Solver.Ex
{
    static public partial class EnumerableEx
    {
        static public string AsString(this IEnumerable<char> ie) { return new string(ie.ToArray()); }
        static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") { return string.Join(st, ie); }
        static public T[] Enumerate<T>(this int n, Func<int, T> f) { var a = new T[n]; for (int i = 0; i < n; i++) a[i] = f(i); return a; }
    }
}
#endregion

#region SegTree
[System.Diagnostics.DebuggerDisplay("Data={ToString()}")]
public class SegmentTree
{
    const int Max = (1 << 30) - 1;
    int n;
    int[] data;
    public SegmentTree(int size)
    {
        n = 1;
        while (n < size)
            n <<= 1;
        data = new int[n << 1];
        for (int i = 0; i < data.Length; i++)
            data[i] = -1;
    }

    ///Data[i]>
    public int this[int i] { get { return data[i + n]; } }
    ///Minimum[a,b)>
    public int this[int l, int r] { get { return Query(l, r, 1, 0, n); } }
    // turn kth index value into v
    public void Update(int a, int b, int v)
    {
        Update(a, b, v, 1, 0, n);
    }
    public void Update(int a, int b, int v, int k, int l, int r)
    {
        if (k >= data.Length)
            return;
        if (r <= a || b <= l)
            return;
        if (a <= l && r <= b)
        {
            if (data[k] != -1)
                data[k] |= v;
            else
                data[k] = v;
            Update(a, b, v, k << 1, l, (l + r) >> 1);
            Update(a, b, v, (k << 1) + 1, (l + r) >> 1, r);

        }
        else
        {
            Update(a, b, v, k << 1, l, (l + r) >> 1);
            Update(a, b, v, (k << 1) + 1, (l + r) >> 1, r);
        }
    }
    private int Query(int a, int b, int k, int l, int r)
    {
        if (r <= a || b <= l)
            return Max;
        if (a <= l && r <= b)
            if (data[k] != -1)
                return data[k];
            else return Max;
        else
        {
            var vl = Query(a, b, k << 1, l, (l + r) >> 1);
            var vr = Query(a, b, (k << 1) + 1, (l + r) >> 1, r);
            return vl & vr;
        }
    }
    public override string ToString()
    {
        return string.Join(",", Enumerable.Range(0, n).Select(i => this[i]).Where(v => v != Max));
    }
    public string Visualize()
    {
        var sb = new System.Text.StringBuilder();
        var k = 2;
        var len = n << 1;
        for (int i = 1; i < len; i++)
        {
            if (data[i] != Max) sb.Append(data[i]);
            else sb.Append('-');
            if (i < k - 1) sb.Append(',');
            else if (i < len - 1)
            {
                sb.AppendLine();
                k <<= 1;
            }
        }
        return sb.ToString();

    }
}
#endregion


using System;
using System.IO;
using System.Text;

namespace Interesting_Array
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static int[] t;

        private static void Main(string[] args)
        {
            int n = Next();
            int m = Next();

            var nn = new Tuple<int, int, int>[m];
            for (int i = 0; i < m; i++)
            {
                nn[i] = new Tuple<int, int, int>(Next()-1, Next()-1, Next());
            }

            t = new int[n*4];
            build(new int[n], 1, 0, n - 1);

            foreach (var tuple in nn)
            {
                update(1, 0, n - 1, tuple.Item1, tuple.Item2, tuple.Item3);
            }

            var a = new int[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = get(1, 0, n - 1, i);
            }

            t = new int[n*4];
            build(a, 1, 0, n - 1);

            bool ok = true;
            foreach (var tuple in nn)
            {
                if (sum(1, 0, n - 1, tuple.Item1, tuple.Item2) != tuple.Item3)
                {
                    ok = false;
                    break;
                }
            }

            if (ok)
            {
                writer.WriteLine("YES");
                foreach (int i in a)
                {
                    writer.Write(i);
                    writer.Write(' ');
                }
            }
            else
            {
                writer.WriteLine("NO");
            }

            writer.Flush();
        }

        private static void build(int[] a, int v, int tl, int tr)
        {
            if (tl == tr)
                t[v] = a[tl];
            else
            {
                int tm = (tl + tr)/2;
                build(a, v*2, tl, tm);
                build(a, v*2 + 1, tm + 1, tr);
                t[v] = t[v*2] & t[v*2 + 1];
            }
        }

        private static void update(int v, int tl, int tr, int l, int r, int add)
        {
            if (l > r)
                return;
            if (l == tl && tr == r)
                t[v] |= add;
            else
            {
                int tm = (tl + tr)/2;
                update(v*2, tl, tm, l, Math.Min(r, tm), add);
                update(v*2 + 1, tm + 1, tr, Math.Max(l, tm + 1), r, add);
            }
        }

        private static int get(int v, int tl, int tr, int pos)
        {
            if (tl == tr)
                return t[v];
            int tm = (tl + tr)/2;
            if (pos <= tm)
                return t[v] | get(v*2, tl, tm, pos);
            else
                return t[v] | get(v*2 + 1, tm + 1, tr, pos);
        }

        private static int sum(int v, int tl, int tr, int l, int r)
        {
            if (l > r)
                return 1073741823;
            if (l == tl && r == tr)
                return t[v];
            int tm = (tl + tr)/2;
            return sum(v*2, tl, tm, l, Math.Min(r, tm))
                   & sum(v*2 + 1, tm + 1, tr, Math.Max(l, tm + 1), r);
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;

// (づ°ω°)づﾐ★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
    private const int SIZE = 30;

    public object Solve()
    {
        int n = ReadInt();
        int m = ReadInt();

        var q = new Tuple<int, int, int>[m];
        var add = Enumerable.Repeat(0, n).Select(x => new List<int>()).ToArray();
        var rem = Enumerable.Repeat(0, n).Select(x => new List<int>()).ToArray();
        for (int i = 0; i < m; i++)
        {
            int l = ReadInt() - 1;
            int r = ReadInt() - 1;
            q[i] = Tuple.Create(l, r, ReadInt());
            add[l].Add(i);
            rem[r].Add(i);
        }

        var a = new int[n];
        var count = new int[SIZE];
        var lastZero = Enumerable.Repeat(-1, SIZE).ToArray();
        for (int i = 0; i < n; i++)
        {
            foreach (int x in add[i])
                for (int j = 0; j < SIZE; j++)
                    if ((q[x].Item3 >> j & 1) == 1)
                        count[j]++;
            int c = 0;
            for (int j = 0; j < SIZE; j++)
                if (count[j] > 0)
                    c |= 1 << j;
                else
                    lastZero[j] = i;
            a[i] = c;

            foreach (int x in rem[i])
                for (int j = 0; j < SIZE; j++)
                    if ((q[x].Item3 >> j & 1) == 1)
                        count[j]--;
                    else if (lastZero[j] < q[x].Item1)
                        return "NO";
        }

        Write("YES");
        Write(a);

        return null;
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
#if DEBUG
        reader = new StreamReader("..\\..\\input.txt");
        writer = Console.Out;
        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());
        //reader = new StreamReader("exchange.in");
        //writer = new StreamWriter("exchange.out");
#endif
        try
        {
            object result = new Solver().Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
#if DEBUG
            Console.WriteLine(ex);
#else
            Console.WriteLine(ex);
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }

    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }

    #endregion
}


import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

val MOD = 1_000_000_007L
data class Query(val l: Int, val r: Int, val q: Int)
class Solver(stream: InputStream, private val out: java.io.PrintWriter) {
  fun solve() {
    val N = ni()
    val M = ni()
    val Q = Array(M){Query(ni() - 1, ni() - 1, ni())}
    val imos = Array(2){Array(30){IntArray(N + 10)}}
    for (q in Q) {
      for (j in 0 until 30) {
        val x = q.q shr j and 1
        imos[x][j][q.l]++
        imos[x][j][q.r + 1]--
      }
    }
    for (x in 0 until 2) {
      for (j in 0 until 30) {
        for (i in 1 until N) {
          imos[x][j][i] += imos[x][j][i - 1]
        }
      }
    }
    for (j in 0 until 30) {
      for (i in 0 until N) {
        if (imos[0][j][i] > 0 && imos[1][j][i] > 0) {
          out.println("NO")
          return
        }
      }
    }
    val ans = IntArray(N)
    for (j in 0 until 30) {
      for (i in 0 until N) {
        if (imos[1][j][i] > 0) {
          ans[i] = ans[i] or (1 shl j)
        }
      }
    }
    out.println("YES")
    out.println(ans.joinToString(" "))
  }

  private val isDebug = try {
    // なんか本番でエラーでる
    System.getenv("MY_DEBUG") != null
  } catch (t: Throwable) {
    false
  }

  private var tokenizer: StringTokenizer? = null
  private val reader = BufferedReader(InputStreamReader(stream), 32768)
  private fun next(): String {
    while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
      tokenizer = StringTokenizer(reader.readLine())
    }
    return tokenizer!!.nextToken()
  }

  private fun ni() = next().toInt()
  private fun nl() = next().toLong()
  private fun ns() = next()
  private fun na(n: Int, offset: Int = 0): IntArray {
    return map(n) { ni() + offset }
  }
  private fun nal(n: Int, offset: Int = 0): LongArray {
    val res = LongArray(n)
    for (i in 0 until n) {
      res[i] = nl() + offset
    }
    return res
  }

  private fun na2(n: Int, offset: Int = 0): Array<IntArray> {
    val a  = Array(2){IntArray(n)}
    for (i in 0 until n) {
      for (e in a) {
        e[i] = ni() + offset
      }
    }
    return a
  }

  private inline fun map(n: Int, f: (Int) -> Int): IntArray {
    val res = IntArray(n)
    for (i in 0 until n) {
      res[i] = f(i)
    }
    return res
  }

  private inline fun debug(msg: () -> String) {
    if (isDebug) System.err.println(msg())
  }

  private fun debug(a: LongArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: IntArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: BooleanArray) {
    debug { a.map { if (it) 1 else 0 }.joinToString("") }
  }

  private fun debugDim(A: Array<LongArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }

  /**
   * 勝手にimport消されるのを防ぎたい
   */
  private fun hoge() {
    min(1, 2)
    max(1, 2)
    abs(-10)
  }
}

fun main() {
  val out = java.io.PrintWriter(System.out)
  Solver(System.`in`, out).solve()
  out.flush()
}


import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

val MOD = 1_000_000_007L
data class Query(val l: Int, val r: Int, val q: Int)
class Solver(stream: InputStream, private val out: java.io.PrintWriter) {
  fun solve() {
    val N = ni()
    val M = ni()
    val Q = Array(M){Query(ni() - 1, ni() - 1, ni())}
    val imos = Array(30){IntArray(N + 10)}
    for (q in Q) {
      for (j in 0 until 30) {
        val x = q.q shr j and 1
        if (x == 1) {
          imos[j][q.l]++
          imos[j][q.r + 1]--
        }
      }
    }
    val sum0 = Array(30){IntArray(N + 10)}
    for (j in 0 until 30) {
      for (i in 0 until N) {
        imos[j][i + 1] += imos[j][i]
        sum0[j][i + 1] = sum0[j][i] + (if (imos[j][i] == 0) 1 else 0)
      }
    }
    debugDim(sum0)
    for (q in Q) {
      for (j in 0 until 30) {
        val x = q.q shr j and 1
        if (x == 0 && sum0[j][q.r + 1] - sum0[j][q.l] == 0) {
          out.println("NO")
          return
        }
      }
    }
    val ans = IntArray(N)
    for (j in 0 until 30) {
      for (i in 0 until N) {
        if (imos[j][i] > 0) {
          ans[i] = ans[i] or (1 shl j)
        }
      }
    }
    out.println("YES")
    out.println(ans.joinToString(" "))
  }

  private val isDebug = try {
    // なんか本番でエラーでる
    System.getenv("MY_DEBUG") != null
  } catch (t: Throwable) {
    false
  }

  private var tokenizer: StringTokenizer? = null
  private val reader = BufferedReader(InputStreamReader(stream), 32768)
  private fun next(): String {
    while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
      tokenizer = StringTokenizer(reader.readLine())
    }
    return tokenizer!!.nextToken()
  }

  private fun ni() = next().toInt()
  private fun nl() = next().toLong()
  private fun ns() = next()
  private fun na(n: Int, offset: Int = 0): IntArray {
    return map(n) { ni() + offset }
  }
  private fun nal(n: Int, offset: Int = 0): LongArray {
    val res = LongArray(n)
    for (i in 0 until n) {
      res[i] = nl() + offset
    }
    return res
  }

  private fun na2(n: Int, offset: Int = 0): Array<IntArray> {
    val a  = Array(2){IntArray(n)}
    for (i in 0 until n) {
      for (e in a) {
        e[i] = ni() + offset
      }
    }
    return a
  }

  private inline fun map(n: Int, f: (Int) -> Int): IntArray {
    val res = IntArray(n)
    for (i in 0 until n) {
      res[i] = f(i)
    }
    return res
  }

  private inline fun debug(msg: () -> String) {
    if (isDebug) System.err.println(msg())
  }

  private fun debug(a: LongArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: IntArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: BooleanArray) {
    debug { a.map { if (it) 1 else 0 }.joinToString("") }
  }

  private fun debugDim(A: Array<IntArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }

  /**
   * 勝手にimport消されるのを防ぎたい
   */
  private fun hoge() {
    min(1, 2)
    max(1, 2)
    abs(-10)
  }
}

fun main() {
  val out = java.io.PrintWriter(System.out)
  Solver(System.`in`, out).solve()
  out.flush()
}


#include<bits/stdc++.h>
using namespace std;
#define long int64_t

const int n_max = 100010;

bool T[5 * n_max];
int A[n_max], B[n_max], D[n_max], R[n_max];
int n, m, nt;

inline void t_flush (int x,int k)
{
    if (T[x]) T[k] = T[k + 1] = true;
}

void upd (int u,int v,int x = 1,int l = 1,int r = n)
{
    if (v < l || r < u || T[x]) return;
    if (u <= l && r <= v) {T[x] = true; return;}

    int k = x << 1, mid = (l + r) >> 1;
    t_flush(x, k);
    upd(u, v, k, l, mid);
    upd(u, v, k + 1, mid + 1, r);

    T[x] = T[k] && T[k + 1];
}

bool covered (int u,int v,int x = 1,int l = 1,int r = n)
{
    if (v < l || r < u || T[x]) return true;
    if (u <= l && r <= v) return false;

    int k = x << 1, mid = (l + r) >> 1;
    t_flush(x, k);
    return covered(u, v, k, l, mid) && covered(u, v, k + 1, mid + 1, r);
}

bool check (int t)
{
    fill_n(T + 1, 5 * n, false);

    for (int i = 1; i <= m; ++i)
    if ((D[i] >> t) & 1) upd(A[i], B[i]);

    for (int i = 1; i <= m; ++i)
    if (((D[i] >> t) & 1) == 0 && covered(A[i], B[i])) return false;

    for (int i = 1; i <= n; ++i) R[i] |= covered(i, i) << t;
    return true;
}

void enter ()
{
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= m; ++i) scanf("%d %d %d", A + i, B + i, D + i);
}

void solve ()
{
    for (int i = 0; i < 30; ++i)
    if (!check(i))
    {
        puts("NO");
        return;
    }

    puts("YES");
    for (int i = 1; i <= n; ++i) printf("%d ", R[i]);
}

int main ()
{
    #ifdef isMyPC
        freopen("test.inp","r",stdin);
    #endif

	enter ();
	solve ();

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define long int64_t

const int n_max = 100010;

bool T[5 * n_max][2], U[5 * n_max][2];
int A[n_max], B[n_max], D[n_max], R[n_max];
int n, m, nt;

void u_flush (int x,int k)
{
    if (U[x][0]) U[k][0] = U[k + 1][0] = T[k][0] = T[k + 1][0] = true, U[x][0] = false;
    if (U[x][1]) U[k][1] = U[k + 1][1] = T[k][1] = T[k + 1][1] = true, U[x][1] = false;
}

bool upd (int u,int v,int p,int x = 1,int l = 1,int r = n)
{
    if (v < l || r < u) return true;
    if (u <= l && r <= v)
    {
        if (T[x][p ^ 1]) return false;
        return T[x][p] = U[x][p] = true;
    }

    int k = x << 1, mid = (l + r) >> 1;
    u_flush(x, k);
    bool t = upd(u, v, p, k, l, mid) | upd(u, v, p, k + 1, mid + 1, r);

    T[x][0] = T[k][0] || T[k + 1][0];
    T[x][1] = T[k][1] || T[k + 1][1];
    return t;
}

int get (int u,int x = 1,int l = 1,int r = n)
{
    if (l == r) return T[x][1];

    int k = x << 1, mid = (l + r) >> 1;
    u_flush(x, k);

    if (u <= mid) return get(u, k, l, mid);
    return get(u, k + 1, mid + 1, r);
}

bool check (int t)
{
    fill(T[1], T[5 * n], false);
    fill(U[1], U[5 * n], false);

    for (int i = 1; i <= m; ++i)
    if (!upd(A[i], B[i], (D[i] >> t) & 1)) return false;

    for (int i = 1; i <= n; ++i) R[i] |= get(i) << t;
    return true;
}

void enter ()
{
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= m; ++i) scanf("%d %d %d", A + i, B + i, D + i);
}

void solve ()
{
    for (int i = 0; i < 30; ++i)
    if (!check(i))
    {
        puts("NO");
        return;
    }

    puts("YES");
    for (int i = 1; i <= 20; ++i) printf("%d ", R[i]);
}

int main ()
{
    #ifdef isMyPC
        freopen("test.inp","r",stdin);
    #endif

	enter ();
	solve ();

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define long int64_t
#define ii pair<int,int>
#define eps numeric_limits<double>::epsilon()

const int n_max = 100010;

bool T[5 * n_max][2];
int A[n_max], B[n_max], D[n_max], R[n_max];
int n, m, nt;

void t_flush (int x,int k)
{
    if (T[x][0]) T[k][0] = T[k + 1][0] = true;
    if (T[x][1]) T[k][1] = T[k + 1][1] = true;
}

bool upd (int u,int v,int p,int x = 1,int l = 1,int r = n)
{
    if (v < l || r < u) return true;
    if (u <= l && r <= v)
    {
        if (T[x][p ^ 1]) return false;
        return T[x][p] = true;
    }

    int k = x << 1, mid = (l + r) >> 1;
    t_flush(x, k);
    upd(u, v, p, k, l, mid);
    upd(u, v, p, k + 1, mid + 1, r);

    T[x][0] = T[k][0] || T[k + 1][0];
    T[x][1] = T[k][1] || T[k + 1][1];
}

int get (int u,int x = 1,int l = 1,int r = n)
{
    if (l == r) return T[x][1];

    int k = x << 1, mid = (l + r) >> 1;
    t_flush(x, k);

    if (u <= mid) return get(u, k, l, mid);
    return get(u, k + 1, mid + 1, r);
}

bool check (int t)
{
    fill(T[1], T[5 * n], false);

    for (int i = 1; i <= m; ++i)
    if (!upd(A[i], B[i], (D[i] >> t) & 1)) return false;

    for (int i = 1; i <= n; ++i) R[i] |= get(i) << t;
    return true;
}

void enter ()
{
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= m; ++i) scanf("%d %d %d", A + i, B + i, D + i);
}

void solve ()
{
    for (int i = 0; i < 30; ++i)
    if (!check(i))
    {
        puts("NO");
        return;
    }

    puts("YES");
    for (int i = 1; i <= n; ++i) printf("%d ", R[i]);
}

int main ()
{
	freopen("test.inp","r",stdin);

	enter ();
	solve ();

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define long int64_t

const int n_max = 100010;

bool T[5 * n_max][2], U[5 * n_max][2];
int A[n_max], B[n_max], D[n_max], R[n_max];
int n, m, nt;

void u_flush (int x,int k)
{
    if (U[x][0]) U[k][0] = U[k + 1][0] = T[k][0] = T[k + 1][0] = true, U[x][0] = false;
    if (U[x][1]) U[k][1] = U[k + 1][1] = T[k][1] = T[k + 1][1] = true, U[x][1] = false;
}

bool upd (int u,int v,int p,int x = 1,int l = 1,int r = n)
{
    if (v < l || r < u) return true;
    if (u <= l && r <= v)
    {
        if (T[x][p ^ 1]) return false;
        return T[x][p] = U[x][p] = true;
    }

    int k = x << 1, mid = (l + r) >> 1;
    u_flush(x, k);
    bool t = upd(u, v, p, k, l, mid) | upd(u, v, p, k + 1, mid + 1, r);

    T[x][0] = T[k][0] || T[k + 1][0];
    T[x][1] = T[k][1] || T[k + 1][1];
    return t;
}

int get (int u,int x = 1,int l = 1,int r = n)
{
    if (l == r) return T[x][1];

    int k = x << 1, mid = (l + r) >> 1;
    u_flush(x, k);

    if (u <= mid) return get(u, k, l, mid);
    return get(u, k + 1, mid + 1, r);
}

bool check (int t)
{
    fill(T[1], T[5 * n], false);
    fill(U[1], U[5 * n], false);

    for (int i = 1; i <= m; ++i)
    if (!upd(A[i], B[i], (D[i] >> t) & 1)) return false;

    for (int i = 1; i <= n; ++i) R[i] |= get(i) << t;
    return true;
}

void enter ()
{
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= m; ++i) scanf("%d %d %d", A + i, B + i, D + i);
}

void solve ()
{
    for (int i = 0; i < 30; ++i)
    if (!check(i))
    {
        puts("NO");
        return;
    }

    puts("YES");
    for (int i = 1; i <= n; ++i) printf("%d ", R[i]);
}

int main ()
{
    #ifdef isMyPC
        freopen("test.inp","r",stdin);
    #endif

	enter ();
	solve ();

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define long int64_t

const int n_max = 100010;

bool T[5 * n_max][2], U[5 * n_max][2];
int A[n_max], B[n_max], D[n_max], R[n_max];
int n, m, nt;

void u_flush (int x,int k)
{
    if (U[x][0]) U[k][0] = U[k + 1][0] = T[k][0] = T[k + 1][0] = true, U[x][0] = false;
    if (U[x][1]) U[k][1] = U[k + 1][1] = T[k][1] = T[k + 1][1] = true, U[x][1] = false;
}

bool upd (int u,int v,int p,int x = 1,int l = 1,int r = n)
{
    if (v < l || r < u) return true;
    if (u <= l && r <= v)
    {
        if (T[x][p ^ 1]) return false;
        return T[x][p] = U[x][p] = true;
    }

    int k = x << 1, mid = (l + r) >> 1;
    u_flush(x, k);
    bool t = upd(u, v, p, k, l, mid) || upd(u, v, p, k + 1, mid + 1, r);

    T[x][0] = T[k][0] || T[k + 1][0];
    T[x][1] = T[k][1] || T[k + 1][1];
    return t;
}

int get (int u,int x = 1,int l = 1,int r = n)
{
    if (l == r) return T[x][1];

    int k = x << 1, mid = (l + r) >> 1;
    u_flush(x, k);

    if (u <= mid) return get(u, k, l, mid);
    return get(u, k + 1, mid + 1, r);
}

bool check (int t)
{
    fill(T[1], T[5 * n], false);
    fill(U[1], U[5 * n], false);

    for (int i = 1; i <= m; ++i)
    if (!upd(A[i], B[i], (D[i] >> t) & 1)) return false;

    for (int i = 1; i <= n; ++i) R[i] |= get(i) << t;
    return true;
}

void enter ()
{
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= m; ++i) scanf("%d %d %d", A + i, B + i, D + i);
}

void solve ()
{
    for (int i = 0; i < 30; ++i)
    if (!check(i))
    {
        puts("NO");
        return;
    }

    puts("YES");
    for (int i = 1; i <= n; ++i) printf("%d ", R[i]);
}

int main ()
{
    #ifdef isMyPC
        freopen("test.inp","r",stdin);
    #endif

	enter ();
	solve ();

	return 0;
}


// cfcode v1.7

#include <bits/stdc++.h>
// greater<int>()
// LLONG_MAX , LLONG_MIN , INT_MAX , INT_MIN

/* MACROS */

#define  all(A)			(A).begin() , (A).end()
#define  rall(A)		(A).rbegin() , (A).rend()
#define  sz(A)			(int)(A).size()
#define  pb				push_back
#define  ppb			pop_back
#define  mp				make_pair
#define  ln(X)			(int)(X).length()
#define  square(X)		((X)*(X))
#define  cube(X)		((X)*(X)*(X))
#define  y1				thisisnotnonsenseasyoumaythink
#define  forn(i, n)		for (int i = 0; i < int(n); i++)
#define  forr(i, n)		for (int i = int(n - 1); i >= 0; i--)
#define  fora(i, a, b)  for (int i = int(a); i <= int(b); i++)
#define  forb(i, a, b)  for (int i = int(a); i >= int(b); i--)
#define  fore(it, a)	for(__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define  dbg(vari)		cerr << #vari << " = " << (vari) << endl
#define  dbg2(vari)		cerr << #vari << " = " << (vari) << ", "

//time_t st = clock();

using namespace std;

/* TYPE DEFINITIONS */
typedef		long long		i64;
typedef		vector<int>		vi;
typedef		pair<int,int>	pi;

/* TOOLS */
template <class T> void debug(T a,T b){ for (; a != b; a++) cerr << *a << ' '; cerr << endl; }

/* ALGEBRA */
template <class T> bool isprime(T x) {
	int till = (T)sqrt(x+.0);
	if (x <= 1) return 0;
	if (x == 2) return 1;
	if (x/2*2 == x) return 0;
	for (int i = 3; i <= till; i += 2) if (x/i*i == x) return 0;
	return 1;
}

/* { CONST } */
// const double Pi = acos(-1.0);
// int dir[8][2] = {{+1, +0}, {-1, +0}, {+0, +1}, {+0, -1}, {-1, -1}, {+1, +1}, {+1, -1}, {-1, +1}};
// int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

/* { END } */

int n, m;

const int MAXST = 131072;
struct SegTree {
	int st[2*MAXST][30];

	void set(int v, int vl, int vr, int l, int r, int c) {
		if (r < vl || vr < l)
			return;

		if (l <= vl && vr <= r)
			st[v][c] = 1;
		else {
			set(2*v+1, vl, (vl+vr)/2+0, l, r, c);
			set(2*v+2, (vl+vr)/2+1, vr, l, r, c);
		}
	}
	void set(int l, int r, int c) { set(0, 0, n-1, l, r, c); }

	bool get(int v, int vl, int vr, int l, int r, int c, int x) {
		if (r < vl || vr < l)
			return 1;

		if (l <= vl && vr <= r)
			return st[v][c]|x;
		else {
			int ret = 1;

			ret &= get(2*v+1, vl, (vl+vr)/2+0, l, r, c, x|st[v][c]);
			ret &= get(2*v+2, (vl+vr)/2+1, vr, l, r, c, x|st[v][c]);

			return ret;
		}
	}
	bool get(int l, int r, int c) { return get(0, 0, n-1, l, r, c, 0); }
} segtree;

int l[100000];
int r[100000];
int q[100000];
int res[100000];

int main()
{
	cin >> n;
	cin >> m;

	for (int i = 0; i < m; i++) {
		cin >> l[i];
		cin >> r[i];
		cin >> q[i];

		l[i]--;
		r[i]--;

		for (int bit = 1, c = 0; bit < 1 << 30; bit <<= 1, c++)
			if (q[i] & bit)
				segtree.set(l[i], r[i], c);
	}

	for (int i = 0; i < m; i++)
		for (int bit = 1, c = 0; bit < 1 << 30; bit <<= 1, c++)
			if ((q[i] & bit) == 0 && segtree.get(l[i], r[i], c) == 1) {
				cout << "NO\n";
				return 0;
			}

	cout << "YES\n";

	for (int i = 0; i < n; i++)
		for (int bit = 1, c = 0; bit < 1 << 30; bit <<= 1, c++)
			if (segtree.get(i, i, c) == 1)
				res[i] |= bit;

	for (int i = 0; i < n; i++)
		cout << res[i] << " ";

//	ios_base::sync_with_stdio(false);
//	freopen("input.txt", "r", stdin);		// needs disabled ios_base::sync_with_stdio(false);
//	freopen("output.txt", "w", stdout);		// needs disabled ios_base::sync_with_stdio(false);
//	cin >> noskipws;
//	cin >> skipws;

//	cerr << clock() - st;
//	getchar();
//	getchar();

	return EXIT_SUCCESS;
}


// cfcode v1.7

#include <bits/stdc++.h>
// greater<int>()
// LLONG_MAX , LLONG_MIN , INT_MAX , INT_MIN

/* MACROS */

#define  all(A)			(A).begin() , (A).end()
#define  rall(A)		(A).rbegin() , (A).rend()
#define  sz(A)			(int)(A).size()
#define  pb				push_back
#define  ppb			pop_back
#define  mp				make_pair
#define  ln(X)			(int)(X).length()
#define  square(X)		((X)*(X))
#define  cube(X)		((X)*(X)*(X))
#define  y1				thisisnotnonsenseasyoumaythink
#define  forn(i, n)		for (int i = 0; i < int(n); i++)
#define  forr(i, n)		for (int i = int(n - 1); i >= 0; i--)
#define  fora(i, a, b)  for (int i = int(a); i <= int(b); i++)
#define  forb(i, a, b)  for (int i = int(a); i >= int(b); i--)
#define  fore(it, a)	for(__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define  dbg(vari)		cerr << #vari << " = " << (vari) << endl
#define  dbg2(vari)		cerr << #vari << " = " << (vari) << ", "

//time_t st = clock();

using namespace std;

/* TYPE DEFINITIONS */
typedef		long long		i64;
typedef		vector<int>		vi;
typedef		pair<int,int>	pi;

/* TOOLS */
template <class T> void debug(T a,T b){ for (; a != b; a++) cerr << *a << ' '; cerr << endl; }

/* ALGEBRA */
template <class T> bool isprime(T x) {
	int till = (T)sqrt(x+.0);
	if (x <= 1) return 0;
	if (x == 2) return 1;
	if (x/2*2 == x) return 0;
	for (int i = 3; i <= till; i += 2) if (x/i*i == x) return 0;
	return 1;
}

/* { CONST } */
// const double Pi = acos(-1.0);
// int dir[8][2] = {{+1, +0}, {-1, +0}, {+0, +1}, {+0, -1}, {-1, -1}, {+1, +1}, {+1, -1}, {-1, +1}};
// int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

/* { END } */

int n, m;

const int MAXST = 131072;
struct SegTree {
	int st[2*MAXST][30];

	void set(int v, int vl, int vr, int l, int r, int c) {
		if (r < vl || vr < l)
			return;

		if (l <= vl && vr <= r)
			st[v][c] = 1;
		else {
			set(2*v+1, vl, (vl+vr)/2+0, l, r, c);
			set(2*v+2, (vl+vr)/2+1, vr, l, r, c);
		}
	}
	void set(int l, int r, int c) { set(0, 0, n-1, l, r, c); }

	bool get(int v, int vl, int vr, int l, int r, int c, int x) {
		if (r < vl || vr < l)
			return 1;

		if (l <= vl && vr <= r)
			return st[v][c]|x;
		else {
			int ret = 1;

			ret &= get(2*v+1, vl, (vl+vr)/2+0, l, r, c, x|st[v][c]);
			ret &= get(2*v+2, (vl+vr)/2+1, vr, l, r, c, x|st[v][c]);

			return ret;
		}
	}
	bool get(int l, int r, int c) { return get(0, 0, n-1, l, r, c, 0); }
} segtree;

int l[100000];
int r[100000];
int q[100000];
int res[100000];

int main()
{
	//~ cin >> n;
	//~ cin >> m;
	scanf("%d %d", &n, &m);

	for (int i = 0; i < m; i++) {
		//~ cin >> l[i];
		//~ cin >> r[i];
		//~ cin >> q[i];

		scanf("%d %d %d", &l[i], &r[i], &q[i]);

		l[i]--;
		r[i]--;

		for (int bit = 1, c = 0; bit < 1 << 30; bit <<= 1, c++)
			if (q[i] & bit)
				segtree.set(l[i], r[i], c);
	}

	for (int i = 0; i < m; i++)
		for (int bit = 1, c = 0; bit < 1 << 30; bit <<= 1, c++)
			if ((q[i] & bit) == 0 && segtree.get(l[i], r[i], c) == 1) {
				//~ cout << "NO\n";
				printf("NO\n");
				return 0;
			}

	//~ cout << "YES\n";
	printf("YES\n");

	for (int i = 0; i < n; i++)
		for (int bit = 1, c = 0; bit < 1 << 30; bit <<= 1, c++)
			if (segtree.get(i, i, c) == 1)
				res[i] |= bit;

	for (int i = 0; i < n; i++)
		//~ cout << res[i] << " ";
		printf("%d ", res[i]);

//	ios_base::sync_with_stdio(false);
//	freopen("input.txt", "r", stdin);		// needs disabled ios_base::sync_with_stdio(false);
//	freopen("output.txt", "w", stdout);		// needs disabled ios_base::sync_with_stdio(false);
//	cin >> noskipws;
//	cin >> skipws;

//	cerr << clock() - st;
//	getchar();
//	getchar();

	return EXIT_SUCCESS;
}


// cfcode v1.7

#include <bits/stdc++.h>
// greater<int>()
// LLONG_MAX , LLONG_MIN , INT_MAX , INT_MIN

/* MACROS */

#define  all(A)			(A).begin() , (A).end()
#define  rall(A)		(A).rbegin() , (A).rend()
#define  sz(A)			(int)(A).size()
#define  pb				push_back
#define  ppb			pop_back
#define  mp				make_pair
#define  ln(X)			(int)(X).length()
#define  square(X)		((X)*(X))
#define  cube(X)		((X)*(X)*(X))
#define  y1				thisisnotnonsenseasyoumaythink
#define  forn(i, n)		for (int i = 0; i < int(n); i++)
#define  forr(i, n)		for (int i = int(n - 1); i >= 0; i--)
#define  fora(i, a, b)  for (int i = int(a); i <= int(b); i++)
#define  forb(i, a, b)  for (int i = int(a); i >= int(b); i--)
#define  fore(it, a)	for(__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define  dbg(vari)		{}
//~ #define  dbg(vari)		cerr << #vari << " = " << (vari) << endl
#define  dbg2(vari)		{}
//~ #define  dbg2(vari)		cerr << #vari << " = " << (vari) << ", "
#define  tabzz()         {}
//~ #define  tabzz()         for (int i = 0; i < tabz; i++) cerr << "  ";

//time_t st = clock();

using namespace std;

/* TYPE DEFINITIONS */
typedef		long long		i64;
typedef		vector<int>		vi;
typedef		pair<int,int>	pi;

/* TOOLS */
template <class T> void debug(T a,T b){ for (; a != b; a++) cerr << *a << ' '; cerr << endl; }

/* ALGEBRA */
template <class T> bool isprime(T x) {
	int till = (T)sqrt(x+.0);
	if (x <= 1) return 0;
	if (x == 2) return 1;
	if (x/2*2 == x) return 0;
	for (int i = 3; i <= till; i += 2) if (x/i*i == x) return 0;
	return 1;
}

/* { CONST } */
// const double Pi = acos(-1.0);
// int dir[8][2] = {{+1, +0}, {-1, +0}, {+0, +1}, {+0, -1}, {-1, -1}, {+1, +1}, {+1, -1}, {-1, +1}};
// int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

/* { END } */

int n, m;

int tabz = 0;

const int MAXST = 131072;
struct SegTree {
	int st[2*MAXST];
	int qq[2*MAXST];

	void set(int v, int vl, int vr, int l, int r, int q) {
		if (r < vl || vr < l)
			return;

		if (l <= vl && vr <= r) {
			qq[v] |= q;
			st[v] |= q;
		}
		else {
			qq[2*v+1] |= qq[v];
			st[2*v+1] |= qq[v];
			qq[2*v+2] |= qq[v];
			st[2*v+2] |= qq[v];
			qq[v] = 0;

			set(2*v+1, vl, (vl+vr)/2+0, l, r, q);
			set(2*v+2, (vl+vr)/2+1, vr, l, r, q);

			st[v] = st[2*v+1] & st[2*v+2];
		}
	}
	void set(int l, int r, int q) { set(0, 0, n-1, l, r, q); }

	int get(int v, int vl, int vr, int l, int r) {
		tabzz(); dbg2(v);
		tabzz(); dbg2(vl);
		tabzz(); dbg2(vr);
		tabzz(); dbg2(l);
		tabzz(); dbg2(r);

		if (r < vl || vr < l)
		{
			tabzz(); dbg2(INT_MAX);
			tabzz(); dbg("OUT_OF_RANGE");
			return INT_MAX;
		}

		if (l <= vl && vr <= r)
		{
			tabzz(); dbg2(st[v]);
			tabzz(); dbg("INSIDE_RANGE");
			return st[v];
		}
		else {
			tabzz(); dbg("INTERSECTS");

			int ret = INT_MAX;

			qq[2*v+1] |= qq[v];
			st[2*v+1] |= qq[v];
			qq[2*v+2] |= qq[v];
			st[2*v+2] |= qq[v];
			qq[v] = 0;

			tabz++;
			int x;
				x = get(2*v+1, vl, (vl+vr)/2+0, l, r);
				tabzz(); dbg(x);
				ret &= x;

				x = get(2*v+2, (vl+vr)/2+1, vr, l, r);
				tabzz(); dbg(x);
				ret &= x;
			tabz--;

			st[v] = st[2*v+1] & st[2*v+2];

			tabzz(); dbg(ret);

			return ret;
		}
	}
	int get(int l, int r) { return get(0, 0, n-1, l, r); }
} segtree;

int l[100000];
int r[100000];
int q[100000];
int res[100000];

int main()
{
	scanf("%d %d", &n, &m);

	for (int i = 0; i < m; i++) {
		scanf("%d %d %d", &l[i], &r[i], &q[i]);

		l[i]--;
		r[i]--;

		segtree.set(l[i], r[i], q[i]);
	}

	for (int i = 0; i < m; i++)
	{
		int foo = segtree.get(l[i], r[i]);

		for (int bit = 1, c = 0; bit < 1 << 30; bit <<= 1, c++)
			if ((q[i] & bit) == 0 && (foo & bit) > 0) {
				printf("NO\n");
				return 0;
			}
	}

	printf("YES\n");

	for (int i = 0; i < n; i++)
	{
		//~ cerr << endl << endl;
		dbg(i);
		printf("%d ", segtree.get(i, i));
	}

//	ios_base::sync_with_stdio(false);
//	freopen("input.txt", "r", stdin);		// needs disabled ios_base::sync_with_stdio(false);
//	freopen("output.txt", "w", stdout);		// needs disabled ios_base::sync_with_stdio(false);
//	cin >> noskipws;
//	cin >> skipws;

//	cerr << clock() - st;
//	getchar();
//	getchar();

	return EXIT_SUCCESS;
}


#include <cstdio>
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <cstring>
#include <string>
#include <set>
#include <stack>
#include <deque>
#define pb push_back

#define mp make_pair
#define f first
#define s second
#define ll long long

const int BITS_SIZE = 30;
using namespace std;

struct Query {
  int l, r , q;
  Query(int _l, int _r, int _q) {
    l = _l;
    r = _r;
    q = _q;
  }
  Query() {
    l = r = q = 0;
  }
  bool operator < (const Query &other) const {
    if (l == other.l) {
      return r < other.r;
    }
    return l < other.l;
  }
};
struct SegmentTree {
  vector<int> data;
  vector<int> keepAnd;
  int N;
  void build(int node, int left, int right) {
    if (left == right) {
      keepAnd[node] = data[left];
      return ;
    }
    int mid = (left + right) / 2;
    build(2 * node, left, mid);
    build(2 * node + 1, mid + 1, right);

    int x = keepAnd[2 * node];
    int y = keepAnd[2 * node + 1];

    int res = (1LL << 30) - 1;
    if (x != -1) {
      res &= x;
    }
    if (y != -1) {
      res &= y;
    }
    keepAnd[node] = res;
  }

  int queryReal(int node, int left, int right, int a, int b) {
    if (a <= left  && right <= b) {
      return keepAnd[node];
    }
    int mid = (left + right) / 2;
    int x = (1LL << 30) - 1;
    int y = x;

    if (a <= mid) {
      x = queryReal(2 * node, left, mid, a , b);
    }
    if (b > mid) {
      y = queryReal(2 * node + 1, mid + 1, right, a, b);
    }
    return x & y;
  }
  SegmentTree(vector<int> _data): data(5 * _data.size(), -1){
    for (int idx = 0; idx < _data.size(); ++idx) {
      data[idx] = _data[idx];
    }
    keepAnd.assign(data.size(), -1);
    N = _data.size() - 1;
    build(1, 1, N);
  }
  int query(int left, int right) {
    return queryReal(1, 1, N, left, right);
  }
};
vector <int> getBits(int q) {

  vector <int> cur_sol;
  while(q > 0) {
    if (q & 1) {
      cur_sol.push_back(1);
    } else {
      cur_sol.push_back(0);
    }
    q >>= 1;
  }
  reverse(cur_sol.begin(), cur_sol.end());
  while(cur_sol.size() < BITS_SIZE) {
    cur_sol.push_back(0);
  }
  return cur_sol;
}
int main() {
#ifndef ONLINE_JUDGE
  ifstream cin("test.in");
  ofstream cout("test.out");
#endif

  int N, M; cin >> N >> M;

  vector <Query> allQ(M);
  vector < vector <int> > goesIn(N + 2, vector<int>());
  vector < vector <int> > goesOut(N + 2, vector<int>());

  for (int m = 0; m < M; ++m){
    int l, r, q;
    cin >> l >> r >> q;
    allQ[m] = Query(l, r, q);

    goesIn[l].push_back(q);
    goesOut[r + 1].push_back(q);
  }
  vector <int> load(31, 0);
  vector <int> setValue(N + 1, 0);
  for (int i = 1; i <= N; ++i) {
    for (auto q: goesOut[i]) {
      vector<int> q_bits = getBits(q);
      for (int k = 0; k < 30; ++k) {
        load[k] -= q_bits[k];
      }
    }
    for (auto q: goesIn[i]) {
      vector <int> q_bits = getBits(q);
      for (int k = 0; k < 30; ++k) {
        load[k] += q_bits[k];
      }
    }
    for (int k = 0; k < 30; ++k) {
      if (load[k] > 0) {
        setValue[i] |= 1 << k;
      }
    }
  }
  SegmentTree T(setValue);

  for (const auto &iter_q: allQ) {
    if (T.query(iter_q.l, iter_q.r) != iter_q.q) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= N; ++i) {
    cout << setValue[i] << " " ;
  }
  return 0;
}


#include <cstdio>
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <cstring>
#include <string>
#include <set>
#include <stack>
#include <deque>
#define pb push_back

#define mp make_pair
#define f first
#define s second
#define ll long long

const int BITS_SIZE = 30;
using namespace std;

struct Query {
  int l, r , q;
  Query(int _l, int _r, int _q) {
    l = _l;
    r = _r;
    q = _q;
  }
  Query() {
    l = r = q = 0;
  }
  bool operator < (const Query &other) const {
    if (l == other.l) {
      return r < other.r;
    }
    return l < other.l;
  }
};
struct SegmentTree {
  vector<int> data;
  vector<int> keepAnd;
  int N;
  void build(int node, int left, int right) {
    if (left == right) {
      keepAnd[node] = data[left];
      return ;
    }
    int mid = (left + right) / 2;
    build(2 * node, left, mid);
    build(2 * node + 1, mid + 1, right);

    int x = keepAnd[2 * node];
    int y = keepAnd[2 * node + 1];

    int res = (1LL << 30) - 1;
    if (x != -1) {
      res &= x;
    }
    if (y != -1) {
      res &= y;
    }
    keepAnd[node] = res;
  }

  int queryReal(int node, int left, int right, int a, int b) {
    if (a <= left  && right <= b) {
      return keepAnd[node];
    }
    int mid = (left + right) / 2;
    int x = (1LL << 30) - 1;
    int y = x;

    if (a <= mid) {
      x = queryReal(2 * node, left, mid, a , b);
    }
    if (b > mid) {
      y = queryReal(2 * node + 1, mid + 1, right, a, b);
    }
    return x & y;
  }
  SegmentTree(vector<int> _data): data(5 * _data.size(), -1){
    for (int idx = 0; idx < _data.size(); ++idx) {
      data[idx] = _data[idx];
    }
    keepAnd.assign(data.size(), -1);
    N = _data.size() - 1;
    build(1, 1, N);
  }
  int query(int left, int right) {
    return queryReal(1, 1, N, left, right);
  }
};
vector <int> getBits(int q) {

  vector <int> cur_sol(BITS_SIZE);
  for (int i = 0; i < BITS_SIZE; ++i) {
    if (q & (1 << i)) {
      cur_sol[i] = 1;
    } else {
      cur_sol[i] = 0;
    }
  }
  return cur_sol;
}
int main() {
#ifndef ONLINE_JUDGE
  ifstream cin("test.in");
  ofstream cout("test.out");
#endif

  int N, M; cin >> N >> M;

  vector <Query> allQ(M);
  vector < vector <int> > goesIn(N + 2, vector<int>());
  vector < vector <int> > goesOut(N + 2, vector<int>());

  for (int m = 0; m < M; ++m){
    int l, r, q;
    cin >> l >> r >> q;
    allQ[m] = Query(l, r, q);

    goesIn[l].push_back(q);
    goesOut[r + 1].push_back(q);
  }
  vector <int> load(31, 0);
  vector <int> setValue(N + 1, 0);
  for (int i = 1; i <= N; ++i) {
    for (auto q: goesOut[i]) {
      vector<int> q_bits = getBits(q);
      for (int k = 0; k < 30; ++k) {
        load[k] -= q_bits[k];
      }
    }
    for (auto q: goesIn[i]) {
      vector <int> q_bits = getBits(q);
      for (int k = 0; k < 30; ++k) {
        load[k] += q_bits[k];
      }
    }
    for (int k = 0; k < 30; ++k) {
      if (load[k] > 0) {
        setValue[i] |= 1 << k;
      }
    }
  }
  SegmentTree T(setValue);
  /*
  for (int i = 1; i <= N; ++i) {
    cerr << setValue[i] << " ";
  }
  */
  for (const auto &iter_q: allQ) {
    if (T.query(iter_q.l, iter_q.r) != iter_q.q) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= N; ++i) {
    cout << setValue[i] << " " ;
  }
  return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <queue>
#include <vector>
#include <string.h>
#include <cstdio>
#include <set>
#include <string>
#include <iostream>
#include <sstream>
#define MAX 1e9
using namespace std;
int b[100005],no;
struct cc
{
    int l,r,q;
}p[100005];
struct tree
{
    int l,r,q;
}a[400005];
void build(int id,int l,int r)
{
    a[id].q=0;
    a[id].l=l;
    a[id].r=r;
    if(l<r)
    {
        int mid=(l+r)/2;
        build(id*2,l,mid);
        build(id*2+1,mid+1,r);
    }
}
void update(int id,int l,int r,int q)
{
    if(a[id].l==l&&a[id].r==r)
    {
        a[id].q|=q;
        return;
    }
    int mid=(a[id].l+a[id].r)/2;
    if(mid<l) update(id*2+1,l,r,q);
    else if(mid>=r) update(id*2,l,r,q);
    else
    {
        update(id*2,l,mid,q);
        update(id*2+1,mid+1,r,q);
    }
}
void ss1(int id)
{
    if(a[id].l==a[id].r) return;
    a[id*2].q|=a[id].q;
    a[id*2+1].q|=a[id].q;
    ss1(id*2);
    ss1(id*2+1);
}
void ss2(int id)
{
    if(a[id].l==a[id].r) return;
    ss2(id*2);
    ss2(id*2+1);
    a[id].q=a[id*2].q&a[id*2+1].q;
}
void query(int id,int l,int r)
{
    if(a[id].l==l&&a[id].r==r)
    {
        no&=a[id].q;
        return;
    }
    int mid=(a[id].l+a[id].r)/2;
    if(mid>=r) query(id*2,l,r);
    else if(mid<l) query(id*2+1,l,r);
    else
    {
        query(id*2,l,mid);
        query(id*2+1,mid+1,r);
    }
}
void s(int id)
{
    if(a[id].l==a[id].r) b[a[id].l]=a[id].q;
    else
    {
        s(id*2);
        s(id*2+1);
    }
}
int main()
{
    int n,m,i,j,max,f;
    scanf("%d%d",&n,&m);
    build(1,1,n);
    for(i=0;i<m;i++)
    {
        scanf("%d%d%d",&p[i].l,&p[i].r,&p[i].q);
        update(1,p[i].l,p[i].r,p[i].q);
    }
    ss1(1);
    ss2(1);
    s(1);
    for(i=0;i<m;i++)
    {
        no=(1<<30)-1;
        query(1,p[i].l,p[i].r);
        if(no!=p[i].q) break;
    }
    if(i<m) printf("NO\n");
    else
    {
        printf("YES\n");
        for(i=1;i<n;i++) printf("%d ",b[i]);
        printf("%d\n",b[i]);
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <queue>
#include <vector>
#include <string.h>
#include <cstdio>
#include <set>
#include <string>
#include <iostream>
#include <sstream>
#define MAX 1e9
using namespace std;
struct cc
{
    int l,r,q;
}p[100005];
int main()
{
    int n,m,i,j,a[100005]={0},max,f;
    scanf("%d%d",&n,&m);
    for(i=0,max=0;i<30;i++) max=(max<<1)+1;
    for(i=0;i<=n;i++) a[i]=max;
    for(i=0;i<m;i++)
    {
        scanf("%d%d%d",&p[i].l,&p[i].r,&p[i].q);
        for(j=p[i].l;j<=p[i].r;j++) a[j]=a[j]&p[i].q;
    }
    for(i=0;i<m;i++)
    {
        for(j=p[i].l,f=a[j];j<=p[i].r;j++) f=f&a[j];
        if(f!=p[i].q) break;
    }
    if(i<m) printf("NO\n");
    else
    {
        printf("YES\n");
        for(i=1;i<n;i++) printf("%d ",a[i]);
        printf("%d\n",a[i]);
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <queue>
#include <vector>
#include <string.h>
#include <cstdio>
#include <set>
#include <string>
#include <iostream>
#include <sstream>
#define MAX 1e9
using namespace std;
int b[100005],no;
struct cc
{
    int l,r,q;
}p[100005];
struct tree
{
    int l,r,q;
}a[400005];
void build(int id,int l,int r)
{
    a[id].q=0;
    a[id].l=l;
    a[id].r=r;
    if(l<r)
    {
        int mid=(l+r)/2;
        build(id*2,l,mid);
        build(id*2+1,mid+1,r);
    }
}
void update(int id,int l,int r,int q)
{
    if(a[id].l>r||a[id].r<l) return;
    a[id].q|=q;
    update(id*2,l,r,q);
    update(id*2+1,l,r,q);
}
void ss1(int id)
{
    if(a[id].l==a[id].r) return;
    a[id*2].q|=a[id].q;
    a[id*2+1].q|=a[id].q;
    ss1(id*2);
    ss1(id*2+1);
}
void ss2(int id)
{
    if(a[id].l==a[id].r) return;
    ss2(id*2);
    ss2(id*2+1);
    a[id].q=a[id*2].q&a[id*2+1].q;
}
void query(int id,int l,int r)
{
    if(a[id].l==l&&a[id].r==r)
    {
        no&=a[id].q;
        return;
    }
    int mid=(a[id].l+a[id].r)/2;
    if(mid>=r) query(id*2,l,r);
    else if(mid<l) query(id*2+1,l,r);
    else
    {
        query(id*2,l,mid);
        query(id*2+1,mid+1,r);
    }
}
void s(int id)
{
    if(a[id].l==a[id].r) b[a[id].l]=a[id].q;
    else
    {
        s(id*2);
        s(id*2+1);
    }
}
int main()
{
    int n,m,i,j,max,f;
    scanf("%d%d",&n,&m);
    build(1,1,n);
    for(i=0;i<m;i++)
    {
        scanf("%d%d%d",&p[i].l,&p[i].r,&p[i].q);
        update(1,p[i].l,p[i].r,p[i].q);
    }
    ss1(1);
    ss2(1);
    s(1);
    for(i=0;i<m;i++)
    {
        no=(1<<30)-1;
        query(1,p[i].l,p[i].r);
        if(no!=p[i].q) break;
    }
    if(i<m) printf("NO\n");
    else
    {
        printf("YES\n");
        for(i=1;i<n;i++) printf("%d ",b[i]);
        printf("%d\n",b[i]);
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <queue>
#include <vector>
#include <string.h>
#include <cstdio>
#include <set>
#include <string>
#include <iostream>
#include <sstream>
#define MAX 1e9
using namespace std;
struct cc
{
    int l,r,q;
}p[100005];
int main()
{
    int n,m,i,j,a[100005]={0},max,f;
    scanf("%d%d",&n,&m);
    for(i=0;i<m;i++)
    {
        scanf("%d%d%d",&p[i].l,&p[i].r,&p[i].q);
        for(j=p[i].l;j<=p[i].r;j++) a[j]=a[j]|p[i].q;
    }
    for(i=0;i<m;i++)
    {
        for(j=p[i].l,f=a[j];j<=p[i].r;j++) f=f&a[j];
        if(f!=p[i].q) break;
    }
    if(i<m) printf("NO\n");
    else
    {
        printf("YES\n");
        for(i=1;i<n;i++) printf("%d ",a[i]);
        printf("%d\n",a[i]);
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

/* Template */

#define ll long long
#define foreach(it, S) for(__typeof (S.begin()) it = S.begin(); it != S.end(); it++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define MN(a, b) a = min (a, b)
#define MX(a, b) a = max (a, b)
#define endl '\n'

#define fname ""

#define nxtnt getNext <int>()
#define nxtll getNext <ll>()

template <typename T> inline T getNext () { T s = 1, x = 0, c = getc(stdin); while (c <= 32) c = getc(stdin); if (c == '-')	s = -1, c = getc(stdin); while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getc(stdin); return x * s; }
const double eps = 1e-9;

bool Equals (double x, double y) { return abs (x - y) < eps; }
bool Less (double x, double y) { return (x) < y - eps; }
bool LessOrEqual (double x, double y) { return (x) < y + eps; }

const int MaxN = int (1e5) + 256;
const int K = 320;

struct Block {
	int col;
	vector <int> v;
	Block () : v (v), col (col) {}
	void clear () {
		col = 0;
		v.clear();
	}
	void push_back (int p) {
		v.push_back (p);
	}
} d[K];

int clz (int N) {
	int last = 0;
	for (int i = 0; i < 32; ++i) {
		if (N & (1 << i))
			last = i;
	}
	return last;
}

int n, q, k;

bool ok (int a, int b) {
	int n = min (clz (a), clz (b));
	for (int i = 0; i < n; ++i) {
		if ((a & (1 << i)) != (b & (1 << i)))
			return false;
	}
	return true;
}

bool Check (int x, int y, int v) {
	for (int i = x; i <= y; ) {
		int p = i / k;
		if (i % k == 0 && i + k - 1 <= y) {
			if (ok (d[p].col, v))
				d[p].col |= v;
			else
				return false;
			i += k;
		} else {
			if (ok (d[p].v[i], v))
				d[p].v[i] |= v;
			else
				return false;
			++i;
		}
	}
	return true;
}

void print () {
	for (int i = 0; i < n; ++i) {
		if (d[i / k].v[i] == 0)
			cout << d[i / k].col << " ";
		else
			cout << d[i / k].v[i] << " ";
	}
}

int main () {
	#ifdef lcl
		freopen (fname".in", "r", stdin);
		// freopen (fname".out", "w", stdout);
	#endif

	n = nxtnt, q = nxtnt;
	k = int (sqrt (n * 1.0)) + 1;

	for (int i = 0; i < n; ++i)
		d[i / k].push_back (0);

	while (q--) {
		int l = nxtnt - 1, r = nxtnt - 1, v = nxtnt;
		if (!Check (l, r, v)) {
			cout << "NO";
			return 0;
		}
	}

	print ();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

/* Template */

#define ll long long
#define foreach(it, S) for(__typeof (S.begin()) it = S.begin(); it != S.end(); it++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define MN(a, b) a = min (a, b)
#define MX(a, b) a = max (a, b)
#define endl '\n'

#define fname ""

#define nxtnt getNext <int>()
#define nxtll getNext <ll>()

template <typename T> inline T getNext () { T s = 1, x = 0, c = getc(stdin); while (c <= 32) c = getc(stdin); if (c == '-')	s = -1, c = getc(stdin); while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getc(stdin); return x * s; }
const double eps = 1e-9;

bool Equals (double x, double y) { return abs (x - y) < eps; }
bool Less (double x, double y) { return (x) < y - eps; }
bool LessOrEqual (double x, double y) { return (x) < y + eps; }

const int MaxN = int (1e5) + 256;
const int K = 320;

struct Block {
	int col;
	vector <int> v;
	Block () : v (v), col (col) {}
	void clear () {
		col = 0;
		v.clear();
	}
	void push_back (int p) {
		v.push_back (p);
	}
} d[K];

int clz (int N) {
	return N ? 32 - __builtin_clz (N) : 0;
}

int n, q, k;

bool ok (int a, int b) {
	int n = min (clz (a), clz (b));
	for (int i = 0; i < n; ++i) {
		if ((a & (1 << i)) != (b & (1 << i)))
			return false;
	}
	return true;
}

bool Check (int x, int y, int v) {
	for (int i = x; i <= y; ) {
		int p = i / k;
		if (i % k == 0 && i + k - 1 <= y) {
			if (ok (d[p].col, v))
				d[p].col |= v;
			else
				return false;
			i += k;
		} else {
			if (ok (d[p].v[i], v))
				d[p].v[i] |= v;
			else
				return false;
			++i;
		}
	}
	return true;
}

void print () {
	for (int i = 0; i < n; ++i) {
		if (d[i / k].v[i] == 0)
			cout << d[i / k].col << " ";
		else
			cout << d[i / k].v[i] << " ";
	}
}

int main () {
	/* #ifdef lcl
		freopen (fname".in", "r", stdin);
		// freopen (fname".out", "w", stdout);
	#endif */

	n = nxtnt, q = nxtnt;
	k = int (sqrt (n * 1.0)) + 1;

	for (int i = 0; i < n; ++i)
		d[i / k].push_back (0);

	while (q--) {
		int l = nxtnt - 1, r = nxtnt - 1, v = nxtnt;
		if (!Check (l, r, v)) {
			cout << "NO";
			return 0;
		}
	}

	print ();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

/* Template */

#define ll long long
#define foreach(it, S) for(__typeof (S.begin()) it = S.begin(); it != S.end(); it++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define MN(a, b) a = min (a, b)
#define MX(a, b) a = max (a, b)
#define endl '\n'

#define fname ""

#define nxtnt getNext <int>()
#define nxtll getNext <ll>()

template <typename T> inline T getNext () { T s = 1, x = 0, c = getc(stdin); while (c <= 32) c = getc(stdin); if (c == '-')	s = -1, c = getc(stdin); while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getc(stdin); return x * s; }
const double eps = 1e-9;

bool Equals (double x, double y) { return abs (x - y) < eps; }
bool Less (double x, double y) { return (x) < y - eps; }
bool LessOrEqual (double x, double y) { return (x) < y + eps; }

const int MaxN = int (1e5) + 256;
const int K = 320;

struct Block {
	int col;
	vector <int> v;
	Block () : v (v), col (col) {}
	void clear () {
		col = 0;
		v.clear();
	}
	void push_back (int p) {
		v.push_back (p);
	}
} d[K];

int clz (int N) {
	return N ? 32 - __builtin_clz (N) : 0;
}

int n, q, k;

bool ok (int a, int b) {
	int n = min (clz (a), clz (b));
	for (int i = 0; i < n; ++i) {
		if ((a & (1 << i)) != (b & (1 << i)))
			return false;
	}
	return true;
}

bool Check (int x, int y, int v) {
	for (int i = x; i <= y; ) {
		int p = i / k;
		if (i % k == 0 && i + k - 1 <= y) {
			if (ok (d[p].col, v))
				d[p].col |= v;
			else
				return false;
			i += k;
		} else {
			if (ok (d[p].v[i], v))
				d[p].v[i] |= v;
			else
				return false;
			++i;
		}
	}
	return true;
}

void print () {
	for (int i = 0; i < n; ++i) {
		if (d[i / k].v[i] == 0)
			cout << d[i / k].col << " ";
		else
			cout << d[i / k].v[i] << " ";
	}
}

int main () {
	#ifdef lcl
		freopen (fname".in", "r", stdin);
		// freopen (fname".out", "w", stdout);
	#endif

	n = nxtnt, q = nxtnt;
	k = int (sqrt (n * 1.0)) + 1;

	for (int i = 0; i < n; ++i)
		d[i / k].push_back (0);

	while (q--) {
		int l = nxtnt - 1, r = nxtnt - 1, v = nxtnt;
		if (!Check (l, r, v)) {
			cout << "NO";
			return 0;
		}
	}

	print ();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

/* My code is cute, isn't it? :3 */

#define long long long
#define foreach(it, S) for(__typeof (S.begin()) it = S.begin(); it != S.end(); it++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define MN(a, b) a = min (a, b)
#define MX(a, b) a = max (a, b)
#define endl '\n'

#define fname ""

#define nxtnt getNext <int>()
#define nxtll getNext <ll>()

template <typename T> inline T getNext () { T s = 1, x = 0, c = getc(stdin); while (c <= 32) c = getc(stdin); if (c == '-')	s = -1, c = getc(stdin); while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getc(stdin); return x * s; }
const double eps = 1e-9;

bool Equals (double x, double y) { return abs (x - y) < eps; }
bool Less (double x, double y) { return (x) < y - eps; }
bool LessOrEqual (double x, double y) { return (x) < y + eps; }

const int MaxN = int (1e5) + 256;

int value[MaxN * 6], toPush[MaxN * 6];

void updateNode (int id) {
	value[id] = (value[id + id] & value[id + id + 1]);
}

struct node {
	int ll, rr, id;
	node (int l, int r, int id) : ll (l), rr (r), id (id) {
		push ();
	}
	node left () {
		return node (ll, (ll + rr) / 2, id + id);
	}
	node right () {
		return node ((ll + rr) / 2 + 1, rr, id + id + 1);
	}
	void push () {
		if (!toPush[id])
			return;

		if (ll != rr) {
			toPush[id + id] |= toPush[id];
			toPush[id + id + 1] |= toPush[id];
		}

		value[id] |= toPush[id];
		toPush[id] = 0;
	}
	void update (int l, int r, int v) {
		if (ll > r || l > rr)
			return;
		if (l <= ll && rr <= r) {
			toPush[id] |= v;
			push ();
			return;
		}
		left ().update (l, r, v);
		right ().update (l, r, v);
		updateNode (id);
	}
	int get (int l, int r) {
		if (ll > r || l > rr)
			return INT_MAX;
		if (l <= ll && rr <= r) {
			return value[id];
		}
		return (left().get (l, r) & right().get (l, r));
	}
};

int l[MaxN], r[MaxN], va[MaxN];

int main () {
	#ifdef lcl
		freopen (fname".in", "r", stdin);
		// freopen (fname".out", "w", stdout);
	#endif

	int n = nxtnt, m = nxtnt;

	node Root = node (1, n, 1);

	for (int i = 0; i < m; ++i) {
		cin >> l[i] >> r[i] >> va[i];
		Root.update (l[i], r[i], va[i]);
	}

	for (int i = 0; i < m; ++i) {
		if (Root.get (l[i], r[i]) != va[i]) {
			// cout << Root.get (l[i], r[i]) << endl;
			cout << "NO";
			return 0;
		}
	}

	cout << "YES\n";
	for (int i = 1; i <= n; ++i)
		cout << Root.get (i, i) << " ";

	return 0;
}


#include<iostream>
#include<stack>
#include<queue>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<string>
#include<cstring>
#include<map>
#include<numeric>
#include<sstream>
#include<cmath>
using namespace std;
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define pb push_back
#define f(i,x,y) for(int i = x; i<y; i++ )
#define FORV(it,A) for(vector<int>::iterator it = A.begin(); it!= A.end(); it++)
#define FORS(it,A) for(set<int>::iterator it = A.begin(); it!= A.end(); it++)
#define quad(x) (x) * (x)
#define mp make_pair
#define clr(x, y) memset(x, y, sizeof x)
#define fst first
#define snd second
#define sz(X) (int)(X.size())
typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;

pii p[100100];
int q[100100], acc[100100], v[100100][32];
vector <pii> s, aux;
int n, m;
const int BIT = 31;

bool solve() {
	memset(v, -1, sizeof(v));

	f(j, 0, BIT) {
		//cout << "====> j=" << j << endl;
		s.clear();
		f(i, 0, m) if ((q[i] & (1<<j)) == 0) s.pb(p[i]);
		sort(s.begin(), s.end());

		//f(i, 0, s.size()) cout << s[i].fst << ' ' << s[i].snd << endl;

		if (s.size() == 0) {
			f(i, 0, n) v[i][j] = 1;
			continue;
		}

		aux.clear();
		int ini=s[0].fst, fim=s[0].snd;
		f(i, 1, s.size()) {
			if (s[i].fst <= fim) fim = max(fim, s[i].snd);
			else {
				aux.pb( make_pair(ini, fim));
				ini=s[i].fst, fim=s[i].snd;
			}
		}
		aux.pb( make_pair(ini, fim));

		//cout << "aux >> " << endl;
		//f(i, 0, aux.size()) cout << aux[i].fst << ' ' << aux[i].snd << endl;

		f(i, 0, n) v[i][j] = 1;
		f(_i, 0, aux.size())
			f(i, aux[_i].fst, aux[_i].snd+1)
				v[i][j] = 0;
		acc[0] = v[0][j];
		f(i, 1, n) acc[i] = acc[i-1] + v[i][j];

		//f(i, 0, n) cout << acc[i] << ' '; cout << endl;
		f(i, 0, m) if ((q[i]&(1<<j))) {
			int val = acc[ p[i].snd ];
			if (p[i].fst != 0) val -= acc[ p[i].fst - 1 ];

			//cout << "i=" << i << " " << q[i] << "  val=" << val << endl;

			if (val == 0) return false;
		}

	}

	return true;
}

int main() {
	cin >> n >> m;

	f(i, 0, m) {
		scanf("%d %d %d", &p[i].fst, &p[i].snd, &q[i]);
		p[i].fst--; p[i].snd--;
	}

	memset(v, -1, sizeof(v));

	if (!solve()) cout << "NO" << endl;
	else {
		cout << "YES" << endl;
		f(i, 0, n) {
			if (i != 0) printf(" ");
			int val=0;
			f(j, 0, BIT) val = val|(v[i][j]<<j);
			printf("%d", val);
		}
		cout << endl;
	}
	return 0;
}


#include<iostream>
#include<stack>
#include<queue>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<string>
#include<cstring>
#include<map>
#include<numeric>
#include<sstream>
#include<cmath>
using namespace std;
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define pb push_back
#define f(i,x,y) for(int i = x; i<y; i++ )
#define FORV(it,A) for(vector<int>::iterator it = A.begin(); it!= A.end(); it++)
#define FORS(it,A) for(set<int>::iterator it = A.begin(); it!= A.end(); it++)
#define quad(x) (x) * (x)
#define mp make_pair
#define clr(x, y) memset(x, y, sizeof x)
#define fst first
#define snd second
#define sz(X) (int)(X.size())
typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;

pii p[100100];
int q[100100], acc[100100], v[100100][32];
vector <pii> s, aux;
int n, m;
const int BIT = 31;

bool solve() {
	memset(v, -1, sizeof(v));

	f(j, 0, BIT) {
		//cout << "====> j=" << j << endl;
		s.clear();
		f(i, 0, m) if ((q[i] & (1<<j))) s.pb(p[i]);
		sort(s.begin(), s.end());

		//f(i, 0, s.size()) cout << s[i].fst << ' ' << s[i].snd << endl;

		if (s.size() == 0) {
			f(i, 0, n) v[i][j] = 0;
			continue;
		}

		aux.clear();
		int ini=s[0].fst, fim=s[0].snd;
		f(i, 1, s.size()) {
			if (s[i].fst <= fim) fim = max(fim, s[i].snd);
			else {
				aux.pb( make_pair(ini, fim));
				ini=s[i].fst, fim=s[i].snd;
			}
		}
		aux.pb( make_pair(ini, fim));

		//cout << "aux >> " << endl;
		//f(i, 0, aux.size()) cout << aux[i].fst << ' ' << aux[i].snd << endl;

		f(i, 0, n) v[i][j] = 0;
		f(_i, 0, aux.size())
			f(i, aux[_i].fst, aux[_i].snd+1)
				v[i][j] = 1;
		acc[0] = v[0][j];
		f(i, 1, n) acc[i] = acc[i-1] + v[i][j];

		//f(i, 0, n) cout << acc[i] << ' '; cout << endl;
		f(i, 0, m) if ((q[i]&(1<<j)) == 0) {
			int val = acc[ p[i].snd ];
			if (p[i].fst != 0) val -= acc[ p[i].fst - 1 ];

		//	cout << "i=" << i << " " << q[i] << "  val=" << val << endl;

			if (val == p[i].snd-p[i].fst+1) return false;
		}

	}

	return true;
}

int main() {
	cin >> n >> m;

	f(i, 0, m) {
		scanf("%d %d %d", &p[i].fst, &p[i].snd, &q[i]);
		p[i].fst--; p[i].snd--;
	}

	memset(v, -1, sizeof(v));

	if (!solve()) cout << "NO" << endl;
	else {
		cout << "YES" << endl;
		f(i, 0, n) {
			if (i != 0) printf(" ");
			int val=0;
			f(j, 0, BIT) val = val|(v[i][j]<<j);
			printf("%d", val);
		}
		cout << endl;
	}
	return 0;
}