Problem: Zane once had a good sequence a consisting of n integers a1, a2, ..., an — but he has lost it.

A sequence is said to be good if and only if all of its integers are non-negative and do not exceed 109 in value.

<image>

However, Zane remembers having played around with his sequence by applying m operations to it.

There are two types of operations:

1. Find the maximum value of integers with indices i such that l ≤ i ≤ r, given l and r.

2. Assign d as the value of the integer with index k, given k and d.

After he finished playing, he restored his sequence to the state it was before any operations were applied. That is, sequence a was no longer affected by the applied type 2 operations. Then, he lost his sequence at some time between now and then.

Fortunately, Zane remembers all the operations and the order he applied them to his sequence, along with the distinct results of all type 1 operations. Moreover, among all good sequences that would produce the same results when the same operations are applied in the same order, he knows that his sequence a has the greatest cuteness.

We define cuteness of a sequence as the bitwise OR result of all integers in such sequence. For example, the cuteness of Zane's sequence a is a1 OR a2 OR ... OR an.

Zane understands that it might not be possible to recover exactly the lost sequence given his information, so he would be happy to get any good sequence b consisting of n integers b1, b2, ..., bn that:

1. would give the same results when the same operations are applied in the same order, and

2. has the same cuteness as that of Zane's original sequence a.

If there is such a sequence, find it. Otherwise, it means that Zane must have remembered something incorrectly, which is possible.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 3·105) — the number of integers in Zane's original sequence and the number of operations that have been applied to the sequence, respectively.

The i-th of the following m lines starts with one integer ti (<image>) — the type of the i-th operation.

If the operation is type 1 (ti = 1), then three integers li, ri, and xi follow (1 ≤ li ≤ ri ≤ n, 0 ≤ xi ≤ 109) — the leftmost index to be considered, the rightmost index to be considered, and the maximum value of all integers with indices between li and ri, inclusive, respectively.

If the operation is type 2 (ti = 2), then two integers ki and di follow (1 ≤ ki ≤ n, 0 ≤ di ≤ 109) — meaning that the integer with index ki should become di after this operation.

It is guaranteed that xi ≠ xj for all pairs (i, j) where 1 ≤ i < j ≤ m and ti = tj = 1.

The operations are given in the same order they were applied. That is, the operation that is given first was applied first, the operation that is given second was applied second, and so on.

Output

If there does not exist a valid good sequence, print "NO" (without quotation marks) in the first line.

Otherwise, print "YES" (without quotation marks) in the first line, and print n space-separated integers b1, b2, ..., bn (0 ≤ bi ≤ 109) in the second line.

If there are multiple answers, print any of them.

Examples

Input

5 4
1 1 5 19
1 2 5 1
2 5 100
1 1 5 100


Output

YES
19 0 0 0 1


Input

5 2
1 1 5 0
1 1 5 100


Output

NO

Note

In the first sample, it is easy to verify that this good sequence is valid. In particular, its cuteness is 19 OR 0 OR 0 OR 0 OR 1 =  19.

In the second sample, the two operations clearly contradict, so there is no such good sequence.

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.PriorityQueue;
/*

5 2
1 1 5 4
1 2 2 2


5 4
1 1 5 5
1 1 4 5
1 1 3 5
1 1 2 4


4 4
1 1 4 4
1 1 1 1
1 2 2 1
1 3 3 1

2 2
1 1 1 5
2 1 3
1 1 1 2

2 2
1 1 2 5
1 2 2 4


*/

public class f {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		String[] l1 = split(br.readLine());
		int n = Integer.parseInt(l1[0]), m = Integer.parseInt(l1[1]);
		int[] max = new int[n];
		Arrays.fill(max, -1);
		ST forced = new ST(n);
		forced.offerMin(0, n - 1, -1);
		ST bounded = new ST(n);
		boolean good = true;
		int[][] qs = new int[4][m];
		for (int i = 0; i < m; i++) {
			String line = br.readLine();
			String[] ss = split(line);
			for(int j=0;j<ss.length;j++)
				qs[j][i] = Integer.parseInt(ss[j]);
			
			int t = qs[0][i];
			if (t == 2) {
				int k = qs[1][i] - 1, d = qs[2][i];
				if (max[k] == -1) {
					max[k] = bounded.queryMax(k, k);
				}
				forced.update(k, d);
				bounded.offerMin(k, k, -1);
			} else {
				int l = qs[1][i] - 1, r = qs[2][i] - 1, x = qs[3][i];
				bounded.offerMin(l, r, x);
				long v1 = bounded.queryMax(l, r);
				long v2 = forced.queryMax(l, r);
				if (Math.max(v1, v2) != x) {
					good = false;
				}
			}
		}
		if (!good) {
			out.println("NO");
			out.close();
			return;
		}
		HashMap<Integer, Integer> map = new HashMap<>();
		ST result = new ST(n);
		boolean[] isForced = new boolean[n];
		for (int i = 0; i < n; i++) {
			if (max[i] == -1)
				max[i] = bounded.queryMax(i, i);
			if (map.containsKey(max[i])) {
				isForced[map.get(max[i])] = true;
			} else {
				map.put(max[i], i);
			}
			result.update(i, max[i]);
		}
		for (int i = 0; i < n; i++) {
			if(isForced[i]) {
				map.remove(max[i]);
			}
		}
		forced = new ST(n);
		forced.offerMin(0, n - 1, -1);
		for (int i = 0; i < m; i++) {
			int t = qs[0][i];
			if (t == 2) {
				int k = qs[1][i] - 1, d = qs[2][i];
				forced.update(k, d);
			} else {
				int l = qs[1][i] - 1, r = qs[2][i] - 1, x = qs[3][i];
				int v1 = forced.queryMax(l, r);
				Integer idx = map.get(x);
				if (idx != null) {
					if (v1 == x) {
						isForced[idx] = false;
					} else {
						long a = result.queryMax(l, idx - 1);
						long b = result.queryMax(idx + 1, r);
						if (a == x || b == x)
							isForced[idx] = false;
						else
							isForced[idx] = true;
					}
				}
			}
		}
		for (int i = 0; i < n; i++) {
			if (max[i] > (int) 1e9)
				max[i] = (int) 1e9;
		}
		int[] ans = new int[n];
		int ansMask = 0;
		for (int i = 0; i < n; i++) {
			if (!isForced[i])
				continue;
			ansMask |= max[i];
			ans[i] = max[i];
		}
		PriorityQueue<Number> pq = new PriorityQueue<>();
		int[] cnts = new int[32];
		for (int i = 0; i < n; i++) {
			if (isForced[i] || max[i] == 0)
				continue;
			int log = getLog(max[i]);
			cnts[log]++;
			if(cnts[log] <= 2) {
				pq.offer(new Number(i, max[i]));
			}
		}
		while (!pq.isEmpty()) {
			Number u = pq.poll();
			if (u.v == 0)
				break;
			int bit = Integer.highestOneBit(u.v);
			if ((bit & ansMask) != 0) {
				ansMask |= bit - 1;
				ans[u.i] |= bit - 1;
				break;
			}
			ansMask |= bit;
			ans[u.i] |= bit;
			u.v -= bit;
			pq.offer(u);
		}

		out.println("YES");
		for (int i = 0; i < n; i++) {
			if (i != 0)
				out.print(' ');
			out.print(ans[i]);
		}
		out.println();
		out.close();
	}
	
	static int getLog(int v) {
		if(v == 0) return -1;
		return Integer.numberOfTrailingZeros(Integer.highestOneBit(v));
	}

	static class Number implements Comparable<Number> {
		int i, v;

		public Number(int i, int v) {
			this.i = i;
			this.v = v;
		}

		@Override
		public int compareTo(Number o) {
			return -Integer.compare(v, o.v);
		}
	}

	static class ST {
		static int maxInf = Integer.MAX_VALUE;
		static int minInf = Integer.MIN_VALUE;
		int[] max;
		int[] lazyMin;
		int n;

		public ST(int n) {
			this.n = n;
			this.max = new int[n * 4 + 1];
			this.lazyMin = new int[n * 4 + 1];
			Arrays.fill(lazyMin, maxInf);
			init(1, 0, n - 1);
		}

		void init(int i, int l, int r) {
			max[i] = (int) 1e9 + 1;
			lazyMin[i] = maxInf;
			if (l == r)
				return;
			int mid = (l + r) / 2;
			init(i * 2, l, mid);
			init(i * 2 + 1, mid + 1, r);
		}

		void prop(int i) {
			if(lazyMin[i] != maxInf) {
				set(i * 2, lazyMin[i]);
				set(i * 2 + 1, lazyMin[i]);
				lazyMin[i] = maxInf;
			}
		}

		void set(int i, int value) {
			lazyMin[i] = Math.min(lazyMin[i], value);
			max[i] = Math.min(max[i], lazyMin[i]);
		}

		void offerMin(int left, int right, int value) {
			offerMin(1, 0, n - 1, left, right, value);
		}

		void offerMin(int i, int lr, int rr, int left, int right, int value) {
			if (lr == left && rr == right)
				set(i, value);
			else {
				prop(i);
				int mid = (lr + rr) / 2;
				if (left <= mid)
					offerMin(i * 2, lr, mid, left, Math.min(mid, right), value);
				if (mid < right)
					offerMin(i * 2 + 1, mid + 1, rr, Math.max(mid + 1, left), right, value);
				max[i] = Math.max(max[i * 2], max[i * 2 + 1]);
			}
		}

		int queryMax(int left, int right) {
			if (left > right)
				return minInf;
			return queryMax(1, 0, n - 1, left, right);
		}

		int queryMax(int i, int lr, int rr, int left, int right) {
			if (lr == left && rr == right)
				return max[i];
			else {
				prop(i);
				int mid = (lr + rr) / 2;
				int ret = minInf;
				if (left <= mid) {
					int l = queryMax(i * 2, lr, mid, left, Math.min(mid, right));
					ret = Math.max(l, ret);
				}
				if (mid < right) {
					int r = queryMax(i * 2 + 1, mid + 1, rr, Math.max(mid + 1, left), right);
					ret = Math.max(r, ret);
				}
				return ret;
			}
		}

		void update(int idx, int value) {
			update(1, 0, n - 1, idx, value);
		}

		void update(int i, int lr, int rr, int idx, int value) {
			if (lr == idx && rr == idx) {
				max[i] = value;
				lazyMin[i] = maxInf;
			} else {
				prop(i);
				int mid = (lr + rr) / 2;
				if (idx <= mid)
					update(i * 2, lr, mid, idx, value);
				if (mid < idx)
					update(i * 2 + 1, mid + 1, rr, idx, value);
				max[i] = Math.max(max[i * 2], max[i * 2 + 1]);
			}
		}
	}
	static String[] split(String s) {
		int tokenCount = 1;
		for(int i=0;i<s.length();i++) {
			if(s.charAt(i) == ' ')
				tokenCount++;
		}
		String[] ans = new String[tokenCount];
		int l = 0;
		int ptr = 0;
		for(int i=0;i<s.length();i++) {
			if(s.charAt(i) == ' ') {
				ans[ptr++] = s.substring(l,i);
				l = i+1;
			}
		}
		ans[ptr] = s.substring(l,s.length());
		return ans;
	}
}