#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
int n, m;
vector<vector<int> > G;
int CC[500000];
int vis[500000];
int eS[500000];
int eT[500000];
int tak[500000];
int s, t, ds, dt;
vector<pair<int, int> > st;
void dfs(int u, int cc) {
  vis[u] = 1;
  CC[u] = cc;
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (v == t) {
      if (eT[cc] == -1) {
        eT[cc] = u;
      }
    } else if (v == s) {
      if (eS[cc] == -1) {
        eS[cc] = u;
      }
    } else if (!vis[v]) {
      dfs(v, cc);
      st.push_back(pair<int, int>(u, v));
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  memset((eS), (-1), sizeof(eS));
  memset((eT), (-1), sizeof(eT));
  cin >> n >> m;
  G.assign(n, vector<int>());
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  cin >> s >> t >> ds >> dt;
  s--, t--;
  int cc = 0;
  for (int i = 0; i < n; i++) {
    if (i == s || i == t) continue;
    if (vis[i] == 0) {
      dfs(i, cc++);
    }
  }
  int ok = false;
  int s_used = 0, t_used = 0;
  int conn_cc = 0;
  for (int i = 0; i < cc && s_used < ds && t_used < dt; i++) {
    if (!tak[i] && eS[i] != -1 && eT[i] != -1) {
      ok = true;
      st.push_back(pair<int, int>(s, eS[i]));
      st.push_back(pair<int, int>(t, eT[i]));
      t_used++;
      s_used++;
      conn_cc++;
      tak[i] = 1;
      break;
    }
  }
  if (!ok) {
    for (int i = 0; i < G[s].size(); i++) {
      if (G[s][i] == t) {
        ok = true;
        st.push_back(pair<int, int>(s, t));
        t_used++;
        s_used++;
        break;
      }
    }
  }
  if (!ok) {
    cout << "No\n";
    return 0;
  }
  for (int i = 0; i < cc && s_used < ds; i++) {
    if (!tak[i] && eS[i] != -1 && eT[i] == -1) {
      st.push_back(pair<int, int>(s, eS[i]));
      conn_cc++;
      tak[i] = 1;
      s_used++;
    }
  }
  for (int i = 0; i < cc && t_used < dt; i++) {
    if (!tak[i] && eT[i] != -1 && eS[i] == -1) {
      st.push_back(pair<int, int>(t, eT[i]));
      conn_cc++;
      tak[i] = 1;
      t_used++;
    }
  }
  for (int i = 0; i < cc && s_used < ds; i++) {
    if (!tak[i] && eS[i] != -1) {
      st.push_back(pair<int, int>(s, eS[i]));
      s_used++;
      conn_cc++;
      tak[i] = 1;
    }
  }
  for (int i = 0; i < cc && t_used < dt; i++) {
    if (!tak[i] && eT[i] != -1) {
      st.push_back(pair<int, int>(t, eT[i]));
      t_used++;
      conn_cc++;
      tak[i] = 1;
    }
  }
  if (conn_cc == cc) {
    cout << "Yes\n";
    for (int i = 0; i < st.size(); i++) {
      cout << st[i].first + 1 << " " << st[i].second + 1 << endl;
    }
  } else {
    cout << "No\n";
  }
  return 0;
}
