/**
* Author: Sergey Kopeliovich (Burunduk30@gmail.com)
* Date: 2014.05.01
*/
#include <cstdio>
#include <cassert>
#include <algorithm>
using namespace std;
#define forn(i, n) for (int i = 0; i < (int)(n); i++)
const int N = 1e5;
const int M = 1e5;
const int E = 2 * M + 2;
int e = 2, head[N], next[E], f[E], c[E], to[E];
int n, m, s, t, cc, u[N];
int x[N], h[N];
void add( int a, int b ) {
next[e] = head[a], to[e] = b, f[e] = 0, c[e] = 1, head[a] = e++;
next[e] = head[b], to[e] = a, f[e] = 0, c[e] = 0, head[b] = e++;
}
int dfs2( int v ) {
u[v] = cc;
for (int e = head[v]; e; e = next[e]) {
int x = to[e];
if (f[e] > 0 && u[x] != cc && (x == s || dfs2(x))) {
f[e]--, f[e ^ 1]++; // 2i, 2i+1
printf("%d ", x + 1);
return 1;
}
}
return 0;
}
int main() {
#define NAME "snails"
assert(freopen(NAME ".in", "r", stdin));
assert(freopen(NAME ".out", "w", stdout));
assert(scanf("%d%d%d%d", &n, &m, &s, &t) == 4 && n <= N && m <= M);
s--, t--;
while (m--) {
int a, b;
scanf("%d%d", &a, &b), a--, b--;
add(b, a);
}
// t ---> s
h[t] = n, h[s] = 0;
for (int e = head[t]; e; e = next[e])
f[e] = c[e], x[to[e]] += f[e];
int good;
forn(i, n)
cur[i] = head[i];
do {
good = 0;
forn(v, n)
if (v != s && v != t && x[v] > 0) {
good = 1;
while (cur[v] && x[v] > 0) {
int e = cur[v];
if (f[e] < c[e] && h[to[e]] < h[v]) {
int add = min(c[e] - f[e], x[v]);
f[e] += add, f[e ^ 1] -= add;
x[v] -= add, x[to[e]] += add;
}
if (x[v] > 0)
cur[v] = next[e];
}
if (x[v] > 0) {
int m = 2 * n + 1, tmp;
for (int e = head[v]; e; e = next[e])
if (f[e] < c[e] && m > (tmp = h[to[e]] + 1))
m = tmp;
h[v] = m;
cur[v] = head[v];
}
}
} while (good);
if (x[s] < 2) {
puts("NO");
return 0;
}
puts("YES");
forn(_, 2) {
cc++;
dfs2(t);
printf("%d\n", t + 1);
}
return 0;
}