#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, sgn = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') sgn = -1;
  for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ 48);
  return x * sgn;
}
const int N = 1e5 + 10;
int n, m, h[N], need, cnt, rt;
struct edge {
  int v, nxt;
} e[N << 1];
void link(int x, int y) {
  e[++cnt] = (edge){y, h[x]};
  h[x] = cnt;
}
bool vis[N], v[N << 1], req[N];
vector<int> cur, ans;
void dfs(int x) {
  if (req[x]) need = 1;
  cur.push_back(x);
  vis[x] = 1;
  req[x] ^= 1;
  for (int i = h[x], y; i; i = e[i].nxt) {
    if (vis[y = e[i].v]) continue;
    dfs(y);
    cur.push_back(x);
    req[x] ^= 1;
    if (req[y] == 1)
      req[y] ^= 1, req[x] ^= 1, cur.push_back(y), cur.push_back(x);
  }
  if (x == rt && req[x] == 1) cur.pop_back();
}
int main() {
  n = read(), m = read();
  for (int i = 1, u, v; i <= m; i++) {
    u = read(), v = read();
    link(u, v);
    link(v, u);
  }
  for (int i = 1; i <= n; i++) req[i] = read();
  int tot = 0;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) {
      cur.clear();
      rt = i;
      need = 0;
      dfs(i);
      if (need) tot++, ans = cur;
      if (tot > 1) return puts("-1"), 0;
    }
  printf("%lu\n", ans.size());
  for (int x : ans) printf("%d ", x);
  puts("");
  return 0;
}
