#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2E5 + 10, MAXM = 4E5 + 10;
int n, m;
vector<pair<int, int> > E[MAXN];
pair<int, int> e[MAXM];
int fa[MAXN];
int a[2], b[2];
int c[2][MAXN];
bool connFlag;
int find(int x) { return x == fa[x] ? x : (fa[x] = find(fa[x])); }
void solve(int c[], int u, int other) {
  for (int v, i = 0; i < E[u].size(); ++i) {
    if ((v = E[u][i].first) == other) {
      connFlag = true;
      continue;
    }
    int w = find(E[u][i].first);
    if (c[w] == 0) c[w] = v;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) fa[i] = i;
  for (int u, v, i = 0; i < m; ++i) {
    scanf("%d%d", &u, &v);
    e[i] = pair<int, int>(u, v);
    E[u].push_back(pair<int, int>(v, i));
    E[v].push_back(pair<int, int>(u, i));
  }
  scanf("%d%d%d%d", &a[0], &a[1], &b[0], &b[1]);
  sort(e, e + m);
  vector<pair<int, int> > ans;
  int tot = n - 2;
  for (int i = 0; i < m; ++i) {
    if (e[i].first == a[0] || e[i].first == a[1] || e[i].second == a[0] ||
        e[i].second == a[1])
      continue;
    int u = find(e[i].first), v = find(e[i].second);
    if (u != v) {
      fa[u] = v, --tot;
      ans.push_back(e[i]);
    }
  }
  solve(c[0], a[0], a[1]);
  solve(c[1], a[1], a[0]);
  vector<pair<int, int> > lst;
  for (int i = 1; i <= n; ++i) {
    if (c[0][i] && !c[1][i])
      ans.push_back(pair<int, int>(a[0], c[0][i])), --b[0];
    if (c[1][i] && !c[0][i])
      ans.push_back(pair<int, int>(a[1], c[1][i])), --b[1];
    if (c[0][i] && c[1][i]) lst.push_back(pair<int, int>(c[0][i], c[1][i]));
  }
  if (b[0] <= 0 || b[1] <= 0) {
  } else if (lst.size() == 0) {
    if (connFlag)
      ans.push_back(pair<int, int>(a[0], a[1]));
    else {
    }
  } else {
    --b[0], --b[1];
    ans.push_back(pair<int, int>(a[0], lst[0].first));
    ans.push_back(pair<int, int>(a[1], lst[0].second));
    for (int i = 1; i < lst.size(); ++i)
      if (b[0])
        ans.push_back(pair<int, int>(a[0], lst[i].first)), --b[0];
      else if (b[1])
        ans.push_back(pair<int, int>(a[1], lst[i].second)), --b[1];
  }
  if (ans.size() < n - 1)
    puts("No");
  else {
    puts("Yes");
    for (int i = 0; i < ans.size(); ++i)
      printf("%d %d\n", ans[i].first, ans[i].second);
  }
  return 0;
}
