#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const int mm = 5005;
vector<int> graph[mm], con[mm], st, color(mm, -1), vis(mm, 0);
int n, m, a, b, c, cnt[mm][2];
int x, y;
bool no = 0;
void dfs(int node, int col, int root) {
  con[root].push_back(node);
  vis[node] = 1;
  color[node] = col;
  cnt[root][col]++;
  for (int i : graph[node]) {
    if (color[i] == color[node]) {
      no = 1;
      return;
    }
    if (vis[i] == 0) dfs(i, ((col == 0) ? 1 : 0), root);
  }
}
int memo[mm][mm], dir[mm][mm];
int dp(int ind, int sum) {
  if (sum < 0) return 0;
  if (ind == st.size()) {
    if (sum == 0)
      return 1;
    else
      return 0;
  }
  if (memo[ind][sum] != -1) return memo[ind][sum];
  int node = st[ind];
  int c1 = dp(ind + 1, sum - cnt[node][0]);
  int c2 = dp(ind + 1, sum - cnt[node][1]);
  if (c1 != 0) dir[ind][sum] = 0;
  if (c2 != 0) dir[ind][sum] = 1;
  return memo[ind][sum] = (c1 || c2);
}
int main() {
  cin >> n >> m;
  cin >> a >> b >> c;
  memset(cnt, 0, sizeof(cnt));
  memset(memo, -1, sizeof(memo));
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  x = a + c;
  y = b;
  for (int i = 1; i <= n; i++) {
    if (vis[i] == 0) {
      st.push_back(i);
      dfs(i, 0, i);
    }
  }
  if (no or !dp(0, b)) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    int sum = b;
    for (int i = 0; i < st.size(); i++) {
      for (int j : con[st[i]]) {
        if (color[j] == dir[i][sum] and b > 0) {
          color[j] = 2;
          --b;
        } else {
          if (a > 0) {
            color[j] = 1;
            --a;
          } else {
            color[j] = 3;
            --c;
          }
        }
      }
      sum -= cnt[st[i]][dir[i][sum]];
    }
    if (a != 0) cout << a << endl;
    for (int i = 1; i <= n; i++) cout << color[i];
    cout << endl;
  }
}
