#include <bits/stdc++.h>
using namespace std;
int p[200005];
int n, m;
int s, t, ds, dt;
void init() {
  for (int i = 0; i < 200005; i++) {
    p[i] = i;
  }
}
struct Edge {
  int u, v;
} edge[400005];
int fin(int a) {
  if (p[a] != a) p[a] = fin(p[a]);
  return p[a];
}
vector<Edge> ans;
vector<Edge> stedge;
bool vis[400005];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  init();
  for (int i = 0; i < m; i++) {
    cin >> edge[i].u >> edge[i].v;
  }
  cin >> s >> t >> ds >> dt;
  bool st = 0;
  for (int i = 0; i < m; i++) {
    if (edge[i].u == s || edge[i].v == s || edge[i].u == t || edge[i].v == t) {
      stedge.push_back(edge[i]);
      continue;
    }
    int a = fin(edge[i].u), b = fin(edge[i].v);
    if (a != b) {
      ans.push_back(edge[i]);
      p[p[edge[i].u]] = p[edge[i].v];
    }
  }
  memset(vis, 0, sizeof(vis));
  int si = stedge.size();
  int cnt = 0;
  while (1) {
    cnt = 0;
    for (int i = 0; i < si; i++) {
      if (vis[i]) continue;
      if (stedge[i].u == s && stedge[i].v == t) {
        st = 1;
        continue;
      }
      if (stedge[i].u == t && stedge[i].v == s) {
        st = 1;
        continue;
      }
      if (ds > dt) {
        if (stedge[i].u == t || stedge[i].v == t) continue;
      } else if (ds < dt && (stedge[i].u == s || stedge[i].v == s))
        continue;
      vis[i] = 1;
      int a = fin(stedge[i].u), b = fin(stedge[i].v);
      if (a != b) {
        ans.push_back(stedge[i]);
        cnt++;
        if (stedge[i].u == s || stedge[i].v == s)
          ds--;
        else
          dt--;
        p[p[stedge[i].u]] = p[stedge[i].v];
      }
      if (ds < 0 || dt < 0) {
        cout << "No" << '\n';
        return 0;
      }
    }
    if (!cnt) break;
  }
  for (int i = 0; i < si; i++) {
    if (vis[i]) continue;
    if (stedge[i].u == s && stedge[i].v == t) {
      st = 1;
      continue;
    }
    if (stedge[i].u == t && stedge[i].v == s) {
      st = 1;
      continue;
    }
    vis[i] = 1;
    int a = fin(stedge[i].u), b = fin(stedge[i].v);
    if (a != b) {
      ans.push_back(stedge[i]);
      if (stedge[i].u == s || stedge[i].v == s)
        ds--;
      else
        dt--;
      p[p[stedge[i].u]] = p[stedge[i].v];
    }
    if (ds < 0 || dt < 0) {
      cout << "No" << '\n';
      return 0;
    }
  }
  if (fin(s) != fin(t)) {
    if (ds == 0 || dt == 0) {
      cout << "No" << '\n';
      return 0;
    } else {
      ans.push_back((Edge){s, t});
    }
  }
  cout << "Yes" << '\n';
  int len = ans.size();
  for (int i = 0; i < len; i++) {
    cout << ans[i].u << ' ' << ans[i].v << '\n';
  }
  return 0;
}
