#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int v;
  Edge *next;
};
int n, m, mc, ansl, ans[400000], x[100000];
bool vis[100000];
Edge memory[200000], *edge[100000];
void AddEdge(int u, int v) {
  Edge *p = &memory[mc++], *q = &memory[mc++];
  p->v = v, p->next = edge[u];
  q->v = u, q->next = edge[v];
  edge[u] = p, edge[v] = q;
}
void Dfs(int node) {
  vis[node] = true;
  ans[ansl++] = node;
  x[node] ^= 1;
  for (Edge *next = edge[node]; next; next = next->next) {
    if (vis[next->v]) continue;
    Dfs(next->v);
    ans[ansl++] = node;
    x[node] ^= 1;
    if (x[next->v]) {
      ans[ansl++] = next->v;
      ans[ansl++] = node;
      x[next->v] ^= 1;
      x[node] ^= 1;
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0, u, v; i < m; i++) scanf("%d%d", &u, &v), AddEdge(--u, --v);
  for (int i = 0; i < n; i++) scanf("%d", &x[i]);
  for (int i = 0; i < n && ansl >= 0; i++) {
    if (x[i]) {
      if (ansl)
        ansl = -1;
      else {
        Dfs(i);
        if (x[i]) {
          ansl--;
          x[i] = 0;
        }
      }
    }
  }
  if (ansl == -1)
    printf("-1\n");
  else {
    printf("%d\n", ansl);
    for (int i = 0; i + 1 < ansl; i++) printf("%d ", ans[i] + 1);
    if (ansl) printf("%d\n", ans[ansl - 1] + 1);
  }
  getchar();
  getchar();
  return 0;
}
