#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fll;
const int MAX = 5100;
vector<int> vn(3);
vector<vector<int>> g(MAX);
int d[MAX], comp[MAX];
vector<pair<int, int>> cost(MAX, {0, 0});
bool bfs(int x, int c) {
  queue<int> q;
  d[x] = 0;
  q.push(x);
  bool ret = true;
  while (!q.empty()) {
    int y = q.front();
    q.pop();
    comp[y] = c;
    d[y] % 2 ? cost[c].second++ : cost[c].first++;
    for (auto u : g[y]) {
      if (d[u] != -1) {
        if (d[y] % 2 == d[u] % 2) ret = false;
        continue;
      }
      d[u] = d[y] + 1;
      q.push(u);
    }
  }
  return ret;
}
bool memo[MAX][MAX], vismemo[MAX][MAX];
int c;
int dp(int pos, int left) {
  bool& p = memo[pos][left];
  if (pos == c) return p = left == 0;
  if (vismemo[pos][left]) return p;
  bool ret = false;
  if (left - cost[pos].first >= 0) ret |= dp(pos + 1, left - cost[pos].first);
  if (left - cost[pos].second >= 0) ret |= dp(pos + 1, left - cost[pos].second);
  vismemo[pos][left] = true;
  return p = ret;
}
bool choseeven[MAX];
void retrieval(int left) {
  for (int i = 0; i < c; i++) {
    if (left - cost[i].first >= 0 and memo[i + 1][left - cost[i].first]) {
      choseeven[i] = true;
      left -= cost[i].first;
    } else {
      choseeven[i] = false;
      left -= cost[i].second;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < 3; i++) cin >> vn[i];
  int a, b;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  memset(d, -1, sizeof d);
  memset(vismemo, false, sizeof vismemo);
  bool ans = true;
  c = 0;
  for (int i = 0; i < n; i++) {
    if (d[i] == -1) {
      ans &= bfs(i, c);
      c++;
    }
  }
  ans &= dp(0, vn[1]);
  if (ans) {
    cout << "YES" << '\n';
    retrieval(vn[1]);
    for (int i = 0; i < n; i++) {
      if (choseeven[comp[i]]) {
        if (d[i] % 2 == 0)
          cout << 2;
        else {
          if (vn[0]) {
            cout << 1;
            vn[0]--;
          } else
            cout << 3;
        }
      } else {
        if (d[i] % 2)
          cout << 2;
        else {
          if (vn[0]) {
            cout << 1;
            vn[0]--;
          } else
            cout << 3;
        }
      }
    }
    cout << '\n';
  } else
    cout << "NO" << '\n';
  exit(0);
}
