Problem: The Trinitarian kingdom has exactly n = 3k cities. All of them are located on the shores of river Trissisipi, which flows through the whole kingdom. Some of the cities are located on one side of the river, and all the rest are on the other side.

Some cities are connected by bridges built between them. Each bridge connects two cities that are located on the opposite sides of the river. Between any two cities exists no more than one bridge.

The recently inaugurated King Tristan the Third is busy distributing his deputies among cities. In total there are k deputies and the king wants to commission each of them to control exactly three cities. However, no deputy can be entrusted to manage the cities, which are connected by a bridge — the deputy can set a too high fee for travelling over the bridge to benefit his pocket, which is bad for the reputation of the king.

Help King Tristan the Third distribute the deputies between the cities, if it is possible.

Input

The first line contains two integers n and m — the number of cities and bridges (3 ≤ n < 105, n = 3k, 0 ≤ m ≤ 105). Next m lines describe the bridges. The i-th line contains two integers ai and bi — the numbers of cities that are connected by the i-th bridge (1 ≤ ai, bi ≤ n, ai ≠ bi, 1 ≤ i ≤ m).

It is guaranteed that no bridge connects a city with itself and that any two cities are connected with no more than one bridge.

Output

If distributing the deputies in the required manner is impossible, print in a single line "NO" (without the quotes).

Otherwise, in the first line print "YES" (without the quotes), and in the second line print which deputy should be put in charge of each city. The i-th number should represent the number of the deputy (from 1 to k), who should be in charge of city numbered i-th in the input — overall there should be n numbers.

If there are multiple solutions, print any of them.

Examples

Input

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


Output

YES
1 2 1 2 2 1 

Input

3 1
1 2


Output

NO

Solution (in CPP):

Solution:
/* 2013-07-26 11:19:10.893590 */#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#define PQ priority_queue
#define OO 2147483647

using namespace std;

vector <int> C[3];
set <int> Can[200005];
set <int>::iterator it;

int n, m, i, a, b, c1, c2, Now, x, du[100005], s[16];
int e[200005], succ[200005], last[200005], sum;
int h, t, list[100005], belong[100005], Hash[100005];
int h1[100005], h2[100005], h3[100005], Ans[100005], tag;
int list2[100005], tot;

void Work(int Color1);
void MakeAns(int a, int b, int Color);
void bfs(int st);

int main()
{
	scanf("%d %d", &n, &m);
	for (i = 1; i <= m; i++)
	{
		scanf("%d %d", &a, &b);
		e[++sum] = b, succ[sum] = last[a], last[a] = sum;
		e[++sum] = a, succ[sum] = last[b], last[b] = sum;
		du[a]++, du[b]++;
	}
	
	for (i = 1; i <= n; i++)
		if (Hash[i] == 0)
			bfs(i);
	for (i = 1; i <= n; i++)
		C[belong[i]].push_back(i);
	if (s[1] % 3 == 0)
	{
		printf("YES\n");
		c1 = c2 = 0;
		for (i = 1; i <= n; i++)
		{
			if (belong[i] == 1)
			{
				c1++;
				printf("%d", (c1 - 1) / 3 + 1);
			}
			
			else
			{
				c2++;
				printf("%d", s[1] / 3 + (c2 - 1) / 3 + 1);
			}
			
			if (i == n)
				printf("\n");
			else
				printf(" ");
		}
		
		return 0;
	}
	
	
	else if (s[1] % 3 == 1)
		Work(1);
	else
		Work(2);
	printf("NO\n");
	return 0;
}

void Work(int Color1)
{
	int Color2 = 3 - Color1, i, j, k, Now, x, ss;
	for (i = 0; i < s[Color1]; i++)
	{
		Now = C[Color1][i];
		if (du[Now] < s[Color2] - 1)
		{
			tag++;
			for (x = last[Now]; x != 0; x = succ[x])
				h1[e[x]] = tag;
			ss = 0;
			Ans[Now] = 1;
			for (j = 0; j < s[Color2]; j++)
			{
				x = C[Color2][j];
				if (h1[x] == tag)
					continue;
				Ans[x] = 1;
				ss++;
				if (ss == 2)
					break;
			}
			
			c1 = c2 = 0;
			for (j = 1; j <= n; j++)
			{
				if (Ans[j] > 0)
					continue;
				if (belong[j] == Color1)
					c1++, Ans[j] = (c1 - 1) / 3 + 2;
				else
					c2++, Ans[j] = (c2 - 1) / 3 + s[Color1] / 3 + 2;
			}
			
			printf("YES\n");
			for (j = 1; j <= n; j++)
				if (j == n)
					printf("%d\n", Ans[j]);
				else
					printf("%d ", Ans[j]);
			exit(0);
		}
	}
	
	for (i = 0; i < s[Color2]; i++)
	{
		Now = C[Color2][i];
		if (du[Now] > s[Color1] - 2)
			continue;
		tag++;
		for (x = last[Now]; x != 0; x = succ[x])
			h1[e[x]] = tag;
		list2[++tot] = Now;
		for (j = 0; j < s[Color1]; j++)
			if (h1[C[Color1][j]] != tag)
				Can[Now].insert(C[Color1][j]);
		if (tot > 1)
		{
			for (j = 1; j < tot; j++)
			{
				k = list2[j];
				if (Can[k].size() > 3)
				{
					if (Can[Now].size() > 3)
						MakeAns(Now, k, Color1);
					else
					{
						int snow = Can[k].size() + Can[Now].size();
						for (it = Can[Now].begin(); it != Can[Now].end(); it++)
							if (Can[k].find((*it)) != Can[k].end())
								snow--;
						if (snow > 3)
							MakeAns(Now, k, Color1);
					}
				}
				
				else
				{
					int snow = Can[k].size() + Can[Now].size();
					for (it = Can[Now].begin(); it != Can[Now].end(); it++)
						if (Can[k].find((*it)) != Can[k].end())
							snow--;
					if (snow > 3)
						MakeAns(Now, k, Color1);
				}
			}
		}
	}
	
	return;
}

void MakeAns(int a, int b, int Color)
{
	int i, x, ss, cnow, snow;
	for (it = Can[a].begin(); it != Can[a].end(); it++)
		h2[(*it)] = 1;
	for (it = Can[b].begin(); it != Can[b].end(); it++)
		h3[(*it)] = 1;
	Ans[a] = 1;
	ss = 0;
	for (i = 0; i < s[Color]; i++)
	{
		x = C[Color][i];
		if (h2[x] == 1 && h3[x] == 0)
		{
			Ans[x] = 1;
			ss++;
			if (ss == 2)
				break;
		}
	}
	
	if (ss != 2)
	{
		for (i = 0; i < s[Color]; i++)
		{
			x = C[Color][i];
			if (h2[x] == 1 && Ans[x] == 0)
			{
				Ans[x] = 1;
				ss++;
				if (ss == 2)
					break;
			}
		}
	}
	
	Ans[b] = 2;
	ss = 0;
	for (i = 0; i < s[Color]; i++)
	{
		x = C[Color][i];
		if (h3[x] == 1)
		{
			Ans[x] = 2;
			ss++;
			if (ss == 2)
				break;
		}
	}
	
	cnow = 3, snow = 0;
	for (i = 1; i <= n; i++)
	{
		if (Ans[i] == 0 && belong[i] == Color)
			Ans[i] = cnow, snow++;
		if (snow == 3)
			cnow++, snow = 0;
	}
	
	for (i = 1; i <= n; i++)
	{
		if (Ans[i] == 0 && belong[i] == 3 - Color)
			Ans[i] = cnow, snow++;
		if (snow == 3)
			cnow++, snow = 0;
	}
	
	printf("YES\n");
	for (i = 1; i <= n; i++)
		if (i == n)
			printf("%d\n", Ans[i]);
		else
			printf("%d ", Ans[i]);
	exit(0);
	return;
}

void bfs(int st)
{
	list[1] = st, Hash[st] = 1, belong[st] = 1, s[1]++;
	for (h = t = 1; h <= t; h++)
	{
		Now = list[h];
		for (x = last[Now]; x != 0; x = succ[x])
		{
			if (Hash[e[x]] == 1)
				continue;
			belong[e[x]] = 3 - belong[Now];
			s[belong[e[x]]]++;
			list[++t] = e[x];
			Hash[e[x]] = 1;	
		}
	}
	
	return;
}