#include <bits/stdc++.h>
using namespace std;
const int maxn = 4.5e5;
int hd[maxn], to[maxn], ne[maxn], cnt;
void ins(int f, int t) {
  ne[++cnt] = hd[f], hd[f] = cnt, to[cnt] = t;
  ne[++cnt] = hd[t], hd[t] = cnt, to[cnt] = f;
}
int n, m, ans[maxn];
int vis[maxn];
int root;
int output[maxn], ot;
void dfs(int x) {
  ans[x] ^= 1;
  output[ot++] = x;
  vis[x] = 1;
  for (int i = hd[x]; i; i = ne[i]) {
    if (vis[to[i]]) continue;
    dfs(to[i]);
    ans[x] = 1 - ans[x];
    output[ot++] = x;
    if (ans[to[i]]) {
      ans[to[i]] ^= 1;
      output[ot++] = to[i];
      ans[x] ^= 1;
      output[ot++] = x;
    }
  }
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    ins(u, v);
  }
  for (int i = 1; i <= n; i++) scanf("%d", ans + i);
  for (int i = 1; i <= n; i++)
    if (ans[i]) {
      dfs(root = i);
      break;
    }
  if (ans[root]) ans[root] = 0, ot--;
  for (int i = 1; i <= n; i++)
    if (ans[i]) return puts("-1"), 0;
  printf("%d\n", ot);
  for (int i = 0; i < ot; i++) printf("%d ", output[i]);
}
