#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 50;
const int INF = 0x3f3f3f3f;
const int mod = 1e6 + 3;
struct node {
  int to, next;
} e[200010];
int n, m, x, y, ans, cnt, s, a[400010], head[100010];
bool vis[100010], c[100010];
void add() {
  e[++cnt] = {y, head[x]}, head[x] = cnt, e[++cnt] = {x, head[y]},
  head[y] = cnt;
}
void dfs(int u, int fa) {
  vis[u] = 1, a[++ans] = u, c[u] ^= 1;
  for (int i = head[u]; i; i = e[i].next)
    if (!vis[e[i].to]) dfs(e[i].to, u), a[++ans] = u, c[u] ^= 1;
  if (c[u]) {
    a[++ans] = fa, c[fa] ^= 1, a[++ans] = u, c[u] ^= 1;
  }
}
int main(int argc, char *argv[]) {
  if (argc == 2 && strcmp("-debug", argv[1]) == 0) {
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
  }
  scanf("%d%d", &n, &m);
  while (m--) scanf("%d%d", &x, &y), add();
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
    if (c[i]) s = i;
  }
  if (s) {
    dfs(s, -1);
    for (int i = 1; i <= n; i++)
      if (!vis[i] && c[i]) {
        puts("-1");
        return 0;
      }
  }
  if (ans > 1 && a[ans - 1] == -1) ans -= 3;
  printf("%d\n", ans);
  for (int i = 1; i <= ans; i++) printf("%d ", a[i]);
  return 0;
}
