#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const double Pi = acos(-1.0);
const double EPS = 1e-8;
int n, m, s, ds, t, dt, f[N], g[N], w[N];
pair<int, int> e[N << 1];
vector<int> ans, es, et;
int get(int x) { return x == f[x] ? x : f[x] = get(f[x]); }
void arr(const vector<int> &edge, int sr, int msk) {
  for (int i = (0); i < (((int)(edge).size())); ++i) {
    int id = edge[i];
    int u = get(e[id].first ^ e[id].second ^ sr);
    g[u] |= msk;
  }
}
void solve(const vector<int> &edge, int sr, int msk, int &deg) {
  for (int i = (0); i < (((int)(edge).size())); ++i) {
    int id = edge[i];
    int u = get(e[id].first ^ e[id].second ^ sr);
    if (g[u] == msk) {
      ans.push_back(id), --deg, g[u] = 0;
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = (1); i < (n + 1); ++i) f[i] = i;
  for (int i = (0); i < (m); ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    e[i] = make_pair(u, v);
  }
  scanf("%d%d%d%d", &s, &t, &ds, &dt);
  int st = 0;
  for (int i = (0); i < (m); ++i) {
    if ((e[i].first == s && e[i].second == t) ||
        (e[i].first == t && e[i].second == s)) {
      st = i + 1;
      continue;
    }
    if (e[i].first == s || e[i].second == s) {
      es.push_back(i);
      continue;
    }
    if (e[i].first == t || e[i].second == t) {
      et.push_back(i);
      continue;
    }
    int u = get(e[i].first), v = get(e[i].second);
    if (u != v) f[u] = v, ans.push_back(i);
  }
  arr(es, s, 1), arr(et, t, 2);
  for (int i = (1); i < (n + 1); ++i)
    if (i == get(i) && g[i] == 3) {
      for (int j = (0); j < (((int)(es).size())); ++j) {
        int id = es[j];
        int u = get(e[id].first ^ e[id].second ^ s);
        if (u == i) {
          ans.push_back(id), --ds;
          break;
        }
      }
      for (int j = (0); j < (((int)(et).size())); ++j) {
        int id = et[j];
        int u = get(e[id].first ^ e[id].second ^ t);
        if (u == i) {
          ans.push_back(id), --dt;
          break;
        }
      }
      g[i] = 0, st = 0;
      break;
    }
  if (st > 0) ans.push_back(st - 1), --ds, --dt;
  solve(es, s, 1, ds), solve(et, t, 2, dt);
  int ts = ds, tt = dt;
  for (int i = (1); i < (n + 1); ++i)
    if (i == get(i) && g[i] == 3) {
      if (ts > tt) {
        g[i] = 1, --ts;
      } else {
        g[i] = 2, --tt;
      }
    }
  solve(es, s, 1, ds), solve(et, t, 2, dt);
  if (ds >= 0 && dt >= 0) {
    puts("Yes");
    for (int i = (0); i < (((int)(ans).size())); ++i) {
      int id = ans[i];
      printf("%d %d\n", e[id].first, e[id].second);
    }
  } else {
    puts("No");
  }
  return 0;
}
