#include <bits/stdc++.h>
using namespace std;
pair<int, int> isBiPartite(vector<int> &labels, vector<vector<int>> &adj,
                           int start, int initial_label) {
  labels[start] = initial_label;
  int size = 1;
  int partition_size = 1;
  bool is_bipartite = true;
  for (int i = 0; i < adj[start].size() && is_bipartite; i++) {
    if (labels[adj[start][i]] == initial_label) {
      is_bipartite = false;
    }
    if (labels[adj[start][i]] == 0) {
      pair<int, int> p =
          isBiPartite(labels, adj, adj[start][i], -initial_label);
      if (p == make_pair(-1, 1)) {
        is_bipartite = false;
      } else {
        size += p.second;
        partition_size += p.second - p.first;
      }
    }
  }
  if (!is_bipartite) {
    return make_pair(-1, 1);
  } else {
    return make_pair(partition_size, size);
  }
}
vector<pair<int, pair<int, int>>> findBiPartiteComponents(
    vector<int> &labels, vector<vector<int>> &adj, int n) {
  bool possible = true;
  vector<pair<int, pair<int, int>>> components;
  for (int i = 0; i < n && possible; i++) {
    if (labels[i] == 0) {
      pair<int, int> p = isBiPartite(labels, adj, i, 1);
      if (p == make_pair(-1, 1)) {
        possible = false;
      } else {
        components.push_back(make_pair(i, p));
      }
    }
  }
  if (!possible) {
    components.push_back(make_pair(-1, make_pair(-1, -1)));
  }
  return components;
}
void assignLabels(vector<int> &labels, vector<vector<int>> &adj, int start,
                  bool use_2, int *n1, int *n2, int *n3) {
  if (use_2) {
    labels[start] = 2;
    *n2 = *n2 - 1;
  } else {
    if (*n1 > 0) {
      labels[start] = 1;
      *n1 = *n1 - 1;
    } else {
      labels[start] = 3;
      *n3 = *n3 - 1;
    }
  }
  for (int i = 0; i < adj[start].size(); i++) {
    if (labels[adj[start][i]] == 0) {
      assignLabels(labels, adj, adj[start][i], !use_2, n1, n2, n3);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int i, j;
  int n, m, n1, n2, n3, u, v;
  cin >> n >> m >> n1 >> n2 >> n3;
  vector<int> labels(n, 0);
  vector<vector<int>> adj(n);
  for (i = 0; i < m; i += 1) {
    cin >> u >> v;
    adj[u - 1].push_back(v - 1);
    adj[v - 1].push_back(u - 1);
  }
  vector<pair<int, pair<int, int>>> bipartite_components =
      findBiPartiteComponents(labels, adj, n);
  if (bipartite_components.back() == make_pair(-1, make_pair(-1, -1))) {
    cout << "NO\n";
  } else {
    int components = bipartite_components.size();
    int dp[n2 + 1][components];
    for (i = 0; i < n2 + 1; i += 1) {
      for (j = 0; j < components; j += 1) {
        int ans = 0;
        int class_a = bipartite_components[j].second.first;
        int class_b = bipartite_components[j].second.second - class_a;
        if (j == 0) {
          if (class_a == i) {
            ans = 2;
          }
          if (class_b == i) {
            ans = -2;
          }
        } else {
          if (class_a <= i) {
            if (dp[i - class_a][j - 1] != 0) {
              ans = 2;
            }
          }
          if (class_b <= i) {
            if (dp[i - class_b][j - 1] != 0) {
              ans = -2;
            }
          }
        }
        dp[i][j] = ans;
      }
    }
    if (dp[n2][components - 1] == 0) {
      cout << "NO\n";
    } else {
      cout << "YES\n";
      for (i = 0; i < n; i += 1) {
        labels[i] = 0;
      }
      for (i = components - 1; i >= 0; i -= 1) {
        assignLabels(labels, adj, bipartite_components[i].first, dp[n2][i] == 2,
                     &n1, &n2, &n3);
      }
      for (i = 0; i < n; i += 1) {
        cout << labels[i];
      }
      cout << "\n";
    }
  }
  return 0;
}
