#include <bits/stdc++.h>
#pragma warning(disable : 4244 4267 4018 4996 4800)
using namespace std;
istream& in = cin;
ostream& out = cout;
int curnum = 1;
int cnt = 0;
int nextnum() {
  ++cnt;
  if (cnt == 4) {
    ++curnum;
    cnt = 1;
  }
  return curnum;
}
int main() {
  int n, m;
  in >> n >> m;
  vector<vector<int> > e(n);
  vector<int> cnt(n);
  for (int i = 0; i < m; ++i) {
    int a, b;
    in >> a >> b;
    e[a - 1].push_back(b - 1);
    e[b - 1].push_back(a - 1);
    cnt[a - 1]++;
    cnt[b - 1]++;
  }
  vector<int> side(n, -1);
  for (int i = 0; i < n; ++i)
    if (side[i] == -1) {
      side[i] = 0;
      queue<int> q;
      q.push(i);
      while (!q.empty()) {
        int t = q.front();
        q.pop();
        for (int j = 0; j < e[t].size(); ++j) {
          int v = e[t][j];
          if (side[v] == -1) {
            side[v] = 1 - side[t];
            q.push(v);
          }
        }
      }
    }
  vector<int> num(n, -1);
  int sidecnt[2] = {};
  for (int i = 0; i < n; ++i) {
    sidecnt[side[i]]++;
  }
  if (sidecnt[0] % 3 != 0) {
    int s;
    if (sidecnt[0] % 3 == 1)
      s = 0;
    else
      s = 1;
    bool b = false;
    for (int i = 0; i < n; ++i)
      if (side[i] == s && cnt[i] <= sidecnt[1 - s] - 2) {
        b = true;
        num[i] = nextnum();
        vector<int> mark(n);
        for (int j = 0; j < e[i].size(); ++j) {
          int v = e[i][j];
          mark[v] = 1;
        }
        int t = 0;
        for (int j = 0; j < n; ++j)
          if (side[j] == 1 - s && !mark[j]) {
            num[j] = nextnum();
            ++t;
            if (t == 2) break;
          }
        break;
      }
    if (!b) {
      int x = 0;
      for (int i = 0; i < n; ++i)
        if (side[i] == 1 - s && cnt[i] <= sidecnt[s] - 2) {
          num[i] = nextnum();
          vector<int> mark(n);
          for (int j = 0; j < e[i].size(); ++j) {
            int v = e[i][j];
            mark[v] = 1;
          }
          int t = 0;
          for (int j = 0; j < n; ++j)
            if (side[j] == s && !mark[j]) {
              num[j] = nextnum();
              ++t;
              if (t == 2) break;
            }
          ++x;
          if (x == 2) break;
        }
      if (x != 2) {
        out << "NO";
        return 0;
      }
    }
  }
  for (int i = 0; i < n; ++i)
    if (side[i] == 0 && num[i] == -1) {
      num[i] = nextnum();
    }
  for (int i = 0; i < n; ++i)
    if (side[i] == 1 && num[i] == -1) {
      num[i] = nextnum();
    }
  out << "YES\n";
  for (int i = 0; i < n; ++i) out << num[i] << ' ';
  return 0;
}
