#include <bits/stdc++.h>
using namespace std;
long long n, m, red, blue;
long long wanted[3];
vector<long long> graph[5004];
long long col[5004];
pair<long long, long long> ar[5004];
bool vis[5004];
bool dp[5004][5004];
long long root[5004];
long long true_color[5004];
bool check(long long cur) {
  if (vis[cur]) return true;
  vis[cur] = true;
  for (int i = 0; i < graph[cur].size(); i++) {
    long long v = graph[cur][i];
    if (col[cur] == col[v]) return false;
    if (!check(v)) return false;
  }
  return true;
}
void color(long long cur) {
  if (col[cur] == 0)
    red++;
  else
    blue++;
  for (int i = 0; i < graph[cur].size(); i++) {
    long long v = graph[cur][i];
    if (col[v] != -1) continue;
    col[v] = !col[cur];
    color(v);
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < 3; i++) {
    cin >> wanted[i];
  }
  for (int i = 0; i < m; i++) {
    long long u, v;
    cin >> u >> v;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  for (int j = 1; j < n + 1; j++) {
    vis[j] = false;
    col[j] = -1;
  }
  bool can = true;
  long long sz = 0;
  for (int j = 1; j < n + 1; j++) {
    red = 0;
    blue = 0;
    if (col[j] != -1) continue;
    col[j] = 0;
    color(j);
    if (!check(j)) {
      can = false;
      break;
    }
    sz++;
    root[sz] = j;
    ar[sz] = make_pair(red, blue);
  }
  if (!can) {
    cout << "NO" << endl;
    return 0;
  }
  dp[0][0] = true;
  for (int i = 1; i < sz + 1; i++) {
    for (int j = 0; j < wanted[1] + 1; j++) {
      dp[i][j] = 0;
      if (ar[i].first <= j) dp[i][j] |= dp[i - 1][j - ar[i].first];
      if (ar[i].second <= j) dp[i][j] |= dp[i - 1][j - ar[i].second];
    }
  }
  if (!dp[sz][wanted[1]]) {
    cout << "NO" << endl;
    return 0;
  }
  long long j = wanted[1];
  long long i = sz;
  while (i > 0) {
    bool first = (j - ar[i].first >= 0 && dp[i - 1][j - ar[i].first]);
    if (!first) {
      true_color[root[i]] = 0;
      j -= ar[i].second;
    } else {
      true_color[root[i]] = 1;
      j -= ar[i].first;
    }
    i--;
  }
  for (int p = 1; p < n + 1; p++) col[p] = -1;
  for (int p = 1; p < n + 1; p++) {
    if (col[p] != -1) continue;
    col[p] = true_color[p];
    color(p);
  }
  cout << "YES\n";
  for (int p = 1; p < n + 1; p++) {
    if (col[p] == 0) {
      if (wanted[0] > 0) {
        wanted[0]--;
        cout << 1;
      } else
        cout << 3;
    } else
      cout << 2;
  }
  cout << endl;
  return 0;
}
