/**
* Author: Sergey Kopeliovich (Burunduk30@gmail.com)
* Date: 2014.05.01
*/
#include <cstdio>
#include <cassert>
#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];
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 dfs( int v ) {
u[v] = cc;
for (int e = head[v]; e; e = next[e]) {
int x = to[e];
if (f[e] < c[e] && u[x] != cc && (x == s || dfs(x))) {
f[e]++, f[e ^ 1]--; // 2i, 2i+1
return 1;
}
}
return 0;
}
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);
}
forn(_, 2) {
cc++;
if (!dfs(t)) {
puts("NO");
return 0;
}
}
puts("YES");
forn(_, 2) {
cc++;
dfs2(t);
printf("%d\n", t + 1);
}
return 0;
}