#include <bits/stdc++.h>
using namespace std;
int to[2000000], nex[2000000], h[2000000];
int tot, a[2000000], b[2000000], n, m, ans;
int vis[2000000], u, v, root;
void add(int p, int q) {
  tot++;
  to[tot] = q;
  nex[tot] = h[p];
  h[p] = tot;
}
void dfs(int u, int fa) {
  vis[u] = 1;
  b[++ans] = u;
  a[u] ^= 1;
  for (int i = h[u]; i; i = nex[i]) {
    int v = to[i];
    if (!vis[v]) {
      dfs(v, u);
      b[++ans] = u;
      a[u] ^= 1;
    }
  }
  if (a[u]) {
    b[++ans] = fa;
    a[fa] ^= 1;
    b[++ans] = u;
    a[u] ^= 1;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i]) root = i;
  }
  if (root) {
    dfs(root, 0);
    for (int i = 1; i <= n; i++)
      if (!vis[i] && a[i]) {
        printf("-1");
        return 0;
      }
  }
  if (ans > 1 && b[ans - 1] == 0) ans -= 3;
  printf("%d\n", ans);
  for (int i = 1; i <= ans; i++) printf("%d ", b[i]);
  return 0;
}
