#include <bits/stdc++.h>
using namespace std;
template <typename T>
string to_string(const vector<T>& vc, int w) {
  if (vc.empty()) return "";
  if (w + 1 == vc.size()) return to_string(vc[w]);
  return to_string(vc[w]) + "," + to_string(vc, w + 1);
}
template <typename T>
string to_string(const vector<T>& vc) {
  return "{" + to_string(vc, 0) + "}";
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
class DebugStream {
} LOG;
template <typename T>
DebugStream& operator<<(DebugStream& s, const T&) {
  return s;
}
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
const int maxN = 5e3 + 9, maxV = 1e6 + 9, MOD = 1e9 + 7, SQ = 335, lg = 20,
          bs = 29;
vector<int> adj[maxN], vcs[maxN];
int n, m, a, b, c, cc, comp[maxN], zer[maxN], said[maxN], dp[maxN][maxN];
bool vi[maxN];
void dfs(int nd) {
  for (auto sn : adj[nd]) {
    if (comp[sn] != -1) {
      if (said[sn] == said[nd]) {
        cout << "NO\n";
        exit(0);
      }
    } else {
      said[sn] = said[nd] ^ 1;
      vcs[cc].push_back(sn);
      comp[sn] = cc;
      dfs(sn);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> a >> b >> c;
  for (int i = 0, u, v; i < m; i++) {
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 0; i < n; i++) comp[i] = -1;
  for (int i = 0; i < n; i++) {
    if (comp[i] == -1) {
      comp[i] = cc;
      vcs[cc].push_back(i);
      dfs(i);
      cc++;
    }
  }
  for (int u = 0; u < cc; u++)
    for (auto w : vcs[u])
      if (!said[w]) zer[u]++;
  for (int u = 0; u <= cc; u++)
    for (int i = 0; i <= b; i++) dp[u][i] = -1;
  dp[cc][0] = 0;
  for (int u = cc - 1; u >= 0; u--) {
    vector<int> opts({zer[u], int(vcs[u].size()) - zer[u]});
    for (auto el : opts)
      for (int i = 0; i + el <= b; i++)
        if (dp[u + 1][i] != -1) dp[u][i + el] = el;
  }
  if (dp[0][b] == -1) {
    cout << "NO\n";
    return 0;
  }
  int he = b;
  for (int u = 0; u < cc; u++) {
    int eleg = dp[u][he];
    if (eleg != zer[u])
      for (auto w : vcs[u]) said[w] ^= 1;
    he -= eleg;
  }
  assert(he == 0);
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    if (!said[i])
      cout << "2";
    else if (a) {
      cout << "1";
      a--;
    } else
      cout << "3";
  }
  cout << '\n';
}
