#include <bits/stdc++.h>
using namespace std;
void itval(istream_iterator<string> it) {}
template <typename T, typename... Args>
void itval(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  itval(++it, args...);
}
const long long int MOD = 1e9 + 7;
template <typename T>
inline void print(T x) {
  cout << x << "\n";
}
template <typename T>
inline void printvec(T x) {
  for (auto a : x) cout << a << ' ';
  cout << '\n';
}
struct custom {
  bool operator()(const pair<int, pair<int, int> > &p1,
                  const pair<int, pair<int, int> > &p2) const {
    return p1.first < p2.first;
  }
};
long long int get_pow(long long int a, long long int b, long long int M = MOD) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a) % M;
    a = (a * a) % M;
    b >>= 1;
  }
  return res;
}
const long long int N = 5000 + 5, inf = 2e18;
std::vector<int> adj[N];
int cp[2], height[N];
bool vis[N], f;
std::vector<int> have[2];
void dfs(int s, int h) {
  height[s] = h;
  cp[h % 2]++;
  vis[s] = 1;
  for (auto x : adj[s]) {
    if (!vis[x]) {
      dfs(x, h + 1);
    } else if (height[x] % 2 == height[s] % 2) {
      f = false;
    }
  }
}
void dfs2(int s, int h) {
  have[h & 1].push_back(s);
  vis[s] = 1;
  for (auto x : adj[s]) {
    if (!vis[x]) {
      dfs2(x, h + 1);
    }
  }
}
bool dp[N][N];
pair<int, int> par[N][N];
void solve() {
  int n, m, x, y;
  cin >> n >> m;
  int n1, n2, n3;
  cin >> n1 >> n2 >> n3;
  for (long long int i = (long long int)0; i < (long long int)(m); i++) {
    cin >> x >> y;
    x--;
    y--;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  std::vector<pair<int, int> > v;
  std::vector<int> roo;
  for (long long int i = (long long int)0; i < (long long int)(n); i++) {
    if (!vis[i]) {
      f = true;
      cp[0] = cp[1] = 0;
      dfs(i, 0);
      if (!f) {
        cout << "NO\n";
        return;
      }
      v.push_back({cp[0], cp[1]});
      roo.push_back(i);
    }
  }
  dp[0][v[0].first] = 1;
  dp[0][v[0].second] = 1;
  par[0][v[0].first] = {-1, 0};
  par[0][v[0].second] = {-1, 1};
  for (long long int i = (long long int)1; i < (long long int)(v.size()); i++) {
    for (long long int j = (long long int)0; j < (long long int)(N); j++) {
      if (dp[i - 1][j]) {
        dp[i][j + v[i].first] = true;
        par[i][j + v[i].first] = {j, 0};
        dp[i][j + v[i].second] = true;
        par[i][j + v[i].second] = {j, 1};
      }
    }
  }
  m = v.size();
  if (!dp[m - 1][n2]) {
    cout << "NO\n";
    return;
  }
  x = m - 1, y = n2;
  vector<int> take(m);
  while (x >= 0) {
    if (par[x][y].second)
      take.push_back(1);
    else
      take.push_back(0);
    if (x == 0) break;
    y = par[x][y].first;
    x--;
  }
  reverse(take.begin(), take.end());
  memset(vis, false, sizeof vis);
  vector<bool> done(n, false);
  string ans(n, '3');
  for (long long int i = (long long int)0; i < (long long int)(m); i++) {
    have[0].clear();
    have[1].clear();
    dfs2(roo[i], 0);
    for (auto p : have[take[i]]) {
      done[p] = true;
      ans[p] = '2';
    }
  }
  for (long long int i = (long long int)0; i < (long long int)(n); i++) {
    if (n1 > 0 and !done[i]) {
      ans[i] = '1';
      n1--;
    }
  }
  cout << "YES\n" << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int test = 1;
  clock_t z = clock();
  for (long long int tes = (long long int)0; tes < (long long int)(test);
       tes++) {
    solve();
  }
  fprintf(stderr, "Total Time:%.4f\n", (double)(clock() - z) / CLOCKS_PER_SEC),
      fflush(stderr);
  return 0;
}
