#include <bits/stdc++.h>
using namespace std;
struct node {
  int to, next;
} e[200010];
int n, m, x, y, ans, cnt, s, a[400010], head[100010], sum[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, sum[u]++;
  for (int i = head[u]; i; i = e[i].next)
    if (!vis[e[i].to]) dfs(e[i].to, u), a[++ans] = u, sum[u]++;
  if (bool(sum[u] & 1) != c[u]) {
    a[++ans] = fa, sum[fa]++, a[++ans] = u, sum[u]++;
  }
}
int main() {
  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;
}
