#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
int complement(int x) {
  if (x == 1)
    return 2;
  else
    return 1;
}
const int N = 5005;
int n, m;
vector<int> g[N];
int color[N];
int one, two, three;
bool ggwp;
int Black, White;
vector<pair<int, int> > vec;
vector<int> Nodes[N];
void dfs(int node, int c) {
  if (color[node]) {
    if (color[node] == c) return;
    ggwp = 1;
    return;
  }
  color[node] = c;
  Nodes[vec.size()].push_back(node);
  if (c == 1)
    Black++;
  else
    White++;
  for (int i : g[node]) {
    int newc = complement(c);
    dfs(i, newc);
  }
}
int vis[N];
void alter(int node) {
  color[node] = complement(color[node]);
  vis[node] = 1;
  for (int i : g[node]) {
    if (vis[i]) continue;
    alter(i);
  }
}
int dp[N][N];
vector<int> chose;
int call(int pos, int rem) {
  if (pos == vec.size()) {
    return rem == 0;
  }
  if (dp[pos][rem] != -1) return dp[pos][rem];
  int ret = 0;
  if (rem >= vec[pos].first) {
    ret = ret || call(pos + 1, rem - vec[pos].first);
  }
  if (rem >= vec[pos].second) {
    ret = ret || call(pos + 1, rem - vec[pos].second);
  }
  return dp[pos][rem] = ret;
}
void rec(int pos, int rem) {
  if (pos == vec.size()) {
    return;
  }
  if (rem >= vec[pos].first) {
    if (call(pos + 1, rem - vec[pos].first)) {
      chose.push_back(0);
      rec(pos + 1, rem - vec[pos].first);
      return;
    }
  }
  if (rem >= vec[pos].second) {
    if (call(pos + 1, rem - vec[pos].second)) {
      chose.push_back(1);
      rec(pos + 1, rem - vec[pos].second);
      return;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  memset(dp, -1, sizeof(dp));
  cin >> n >> m;
  cin >> one >> two >> three;
  for (int i = 1; i <= m; i++) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    if (color[i] == 0) {
      Black = White = 0;
      dfs(i, 1);
      if (Black > White) {
        alter(i);
        swap(Black, White);
      }
      vec.push_back(make_pair(Black, White));
    }
  }
  if (ggwp == 1) {
    cout << "NO\n";
    return 0;
  }
  if (call(0, two) == 0) {
    cout << "NO\n";
    return 0;
  }
  rec(0, two);
  for (int i = 0; i < vec.size(); i++) {
    if (chose[i] == 0) {
      for (int j : Nodes[i]) {
        if (color[j] == 1)
          color[j] = 2;
        else
          color[j] = 1;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (color[i] == 2) continue;
    if (three) {
      color[i] = 3;
      three--;
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) cout << color[i];
  cout << "\n";
}
