#include <bits/stdc++.h>
using namespace std;
int opp[3] = {0, 2, 1};
vector<vector<int>> gra(5005);
int vis[5005];
int col[5005];
vector<vector<int>> dsu_(5005);
int val[5005][2];
int belong[5005];
int lvl[5005];
int dsu;
void dfs(int u, int par) {
  vis[u] = 1;
  if (par == -1)
    col[u] = 2;
  else
    col[u] = opp[col[par]];
  if (par == -1)
    lvl[u] = 0;
  else
    lvl[u] = lvl[par] + 1;
  lvl[u] %= 2;
  val[dsu][lvl[u]]++;
  dsu_[dsu].push_back(u);
  belong[u] = dsu;
  for (auto v : gra[u]) {
    if (vis[v]) continue;
    dfs(v, u);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  int n1, n2, n3;
  cin >> n1 >> n2 >> n3;
  int c1 = n1 + n3;
  int c2 = n2;
  vector<pair<int, int>> edge;
  for (long long i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    gra[a].push_back(b);
    gra[b].push_back(a);
    edge.push_back({a, b});
  }
  dsu = 0;
  for (long long i = 0; i < 5005; i++)
    for (long long j = 0; j < 2; j++) val[i][j] = 0;
  for (long long i = 0; i < n; i++) {
    if (vis[i]) continue;
    dfs(i, -1);
    dsu++;
  }
  for (long long i = 0; i < m; i++) {
    if (col[edge[i].first] == col[edge[i].second]) {
      cout << "NO\n";
      return (0);
    }
  }
  int dp[dsu][c2 + 1];
  for (long long i = 0; i < dsu; i++)
    for (long long j = 0; j < c2 + 1; j++) dp[i][j] = -1;
  for (long long i = 0; i < 2; i++) dp[0][val[0][i]] = i;
  for (int i = 1; i < dsu; i++) {
    for (long long j = 0; j < c2 + 1; j++) {
      if (dp[i - 1][j] == -1) continue;
      for (long long k = 0; k < 2; k++)
        if (j + val[i][k] <= c2) dp[i][j + val[i][k]] = k;
    }
  }
  if (dp[dsu - 1][c2] == -1) {
    cout << "NO\n";
    return (0);
  }
  int rem = c2;
  for (int i = dsu - 1; i >= 0; i--) {
    if (dp[i][rem] == 0) {
      rem -= val[i][0];
    } else {
      for (auto u : dsu_[i]) col[u] = opp[col[u]];
      rem -= val[i][1];
    }
  }
  for (long long i = 0; i < n; i++) {
    if (!n3) break;
    if (col[i] == 2) continue;
    col[i] = 3;
    n3--;
  }
  cout << "YES\n";
  for (long long i = 0; i < n; i++) cout << col[i];
}
