#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& a) {
  in >> a.first >> a.second;
  return in;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& out, pair<T1, T2> a) {
  out << a.first << " " << a.second;
  return out;
}
template <typename T, typename T1>
T maxs(T& a, T1 b) {
  if (b > a) a = b;
  return a;
}
template <typename T, typename T1>
T mins(T& a, T1 b) {
  if (b < a) a = b;
  return a;
}
const long long N = 5e3 + 5;
vector<long long> g[N];
vector<vector<long long>> com[2];
long long c[N], vis[N];
vector<long long> t[2];
void dfs(long long u) {
  vis[u] = 1;
  t[c[u]].push_back(u);
  for (auto i : g[u]) {
    if (vis[i]) {
      if (c[i] == c[u]) {
        cout << "NO"
             << "\n";
        exit(0);
      }
    } else {
      c[i] = c[u] ^ 1;
      dfs(i);
    }
  }
}
long long solve() {
  long long n, m;
  cin >> n >> m;
  long long n1, n2, n3;
  cin >> n1 >> n2 >> n3;
  for (long long i = 0; i < m; i++) {
    long long a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  long long cur = 0;
  for (long long i = 1; i <= n; i++) {
    if (!vis[i]) {
      cur++;
      t[0].clear();
      t[1].clear();
      dfs(i);
      com[0].push_back(t[0]);
      com[1].push_back(t[1]);
    }
  }
  vector<long long> ans(n + 1);
  vector<vector<long long>> dp(cur + 1, vector<long long>(n + 1));
  dp[0][0] = 1;
  for (long long i = 1; i <= cur; i++) {
    for (long long j = 0; j <= n; j++) {
      long long s = (long long)com[0][i - 1].size();
      if (j >= s) dp[i][j] |= dp[i - 1][j - s];
      s = (long long)com[1][i - 1].size();
      if (j >= s) dp[i][j] |= dp[i - 1][j - s];
    }
  }
  if (!dp[cur][n2]) {
    cout << "NO"
         << "\n";
    return 0;
  }
  long long s = n2;
  long long j = cur;
  while (s > 0) {
    long long sj = (long long)com[0][j - 1].size();
    long long xj = (long long)com[1][j - 1].size();
    if (s >= sj && dp[j - 1][s - sj]) {
      while (!com[0][j - 1].empty()) {
        ans[com[0][j - 1].back()] = 2;
        com[0][j - 1].pop_back();
      }
      s -= sj;
      j--;
    } else {
      assert(s >= xj && dp[j - 1][s - xj]);
      while (!com[1][j - 1].empty()) {
        ans[com[1][j - 1].back()] = 2;
        com[1][j - 1].pop_back();
      }
      s -= xj;
      j--;
    }
  }
  bool f = 0;
  for (long long i = 0; i < cur; i++) {
    if ((long long)com[0][i].size() < (long long)com[1][i].size())
      swap(com[0][i], com[1][i]);
    if (f == 0) {
      if ((long long)com[0][i].size() < n1) {
        n1 -= (long long)com[0][i].size();
        while (!com[0][i].empty()) {
          ans[com[0][i].back()] = 1;
          com[0][i].pop_back();
        }
      } else {
        f = 1;
        for (long long j = 0; j < n1; j++) {
          ans[com[0][i][j]] = 1;
        }
        for (long long j = n1; j < (long long)com[0][i].size(); j++) {
          ans[com[0][i][j]] = 3;
        }
      }
    } else {
      for (long long j = 0; j < (long long)com[0][i].size(); j++) {
        ans[com[0][i][j]] = 3;
      }
    }
  }
  cout << "YES"
       << "\n";
  for (long long i = 1; i <= n; i++) cout << ans[i];
  cout << "\n";
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
