#include <bits/stdc++.h>
using namespace std;
const int INF = 0x6fffffff;
const int MINF = 0x80000000;
const long long mod = 100003;
const int cons = 100001;
const double pi = 3.141592653589793;
int parent[200002];
int deg[200002];
int f[200002];
int cnt[200002];
vector<vector<int> > adj;
int fn(int u) {
  if (f[u] == u) return u;
  return f[u] = fn(f[u]);
}
void unite(int u, int v) {
  cnt[fn(u)] += cnt[fn(v)];
  f[fn(v)] = fn(u);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  adj.resize(n + 1);
  vector<pair<int, int> > es;
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
    if (u > v) swap(u, v);
    es.push_back(make_pair(u, v));
  }
  int s, t, ds, dt;
  scanf("%d%d%d%d", &s, &t, &ds, &dt);
  if (s > t) swap(s, t), swap(ds, dt);
  for (int i = 1; i <= n; i++) {
    f[i] = i;
    cnt[i] = 1;
  }
  vector<pair<int, int> > ans;
  for (auto e : es) {
    if (e.first == s || e.first == t || e.second == s || e.second == t)
      continue;
    int u = fn(e.first);
    int v = fn(e.second);
    if (u == v) continue;
    deg[e.first]++;
    deg[e.second]++;
    ans.push_back(e);
    unite(u, v);
  }
  for (auto e : es) {
    if (e.first != s && e.first != t && e.second != s && e.second != t)
      continue;
    if (e.first == s && e.second == t) continue;
    int u = fn(e.first);
    int v = fn(e.second);
    if (u == v) continue;
    if (e.first == s || e.second == s) {
      if (deg[s] + 1 > ds) continue;
      if (e.first == s) {
        if (adj[e.second].size() > 1) continue;
      } else {
        if (adj[e.first].size() > 1) continue;
      }
    } else if (e.first == t || e.second == t) {
      if (deg[t] + 1 > dt) continue;
      if (e.first == t) {
        if (adj[e.second].size() > 1) continue;
      } else {
        if (adj[e.first].size() > 1) continue;
      }
    }
    deg[e.first]++;
    deg[e.second]++;
    ans.push_back(e);
    unite(u, v);
  }
  for (auto e : es) {
    if (e.first != s && e.first != t && e.second != s && e.second != t)
      continue;
    if (e.first == s && e.second == t) continue;
    int u = fn(e.first);
    int v = fn(e.second);
    if (u == v) continue;
    if (e.first == s || e.second == s) {
      if (deg[s] + 1 > ds) continue;
    } else if (e.first == t || e.second == t) {
      if (deg[t] + 1 > dt) continue;
    }
    deg[e.first]++;
    deg[e.second]++;
    ans.push_back(e);
    unite(u, v);
  }
  for (auto e : es) {
    if (!(e.first == s && e.second == t)) continue;
    int u = fn(e.first);
    int v = fn(e.second);
    if (u == v) continue;
    if (deg[s] + 1 > ds || deg[t] + 1 > dt) continue;
    deg[e.first]++;
    deg[e.second]++;
    ans.push_back(e);
    unite(u, v);
    break;
  }
  if (cnt[fn(1)] != n)
    puts("No");
  else {
    puts("Yes");
    for (auto e : ans) {
      printf("%d %d\n", e.first, e.second);
    }
  }
  return 0;
}
