#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const int maxe = 200005;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
struct Edge {
  int v, next;
} edge[maxe];
int head[maxn], e;
bool vis[maxn];
int odd[maxn];
vector<int> ans;
void add_edge(int u, int v) {
  edge[e].v = v;
  edge[e].next = head[u];
  head[u] = e++;
}
void init() {
  memset(head, -1, sizeof(head));
  e = 0;
}
void dfs(int u, int p) {
  int v;
  odd[u] ^= 1;
  vis[u] = true;
  ans.push_back(u);
  for (int i = head[u]; i != -1; i = edge[i].next) {
    v = edge[i].v;
    if (!vis[v]) {
      dfs(v, u);
      odd[u] ^= 1;
      ans.push_back(u);
    }
  }
  if (odd[u] && p != -1) {
    ans.push_back(p);
    ans.push_back(u);
    odd[u] ^= 1;
    odd[p] ^= 1;
  }
}
int main() {
  int n, m, x, y, flag, be = 1;
  scanf("%d%d", &n, &m);
  init();
  while (m--) {
    scanf("%d%d", &x, &y);
    add_edge(x, y);
    add_edge(y, x);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &odd[i]);
    if (odd[i]) be = i;
  }
  dfs(be, -1);
  flag = odd[be];
  for (int i = 1; i <= n; i++) {
    if (odd[i] && i != be) {
      flag = -1;
      break;
    }
  }
  if (flag == -1)
    printf("-1\n");
  else {
    printf("%d\n", ans.size() - flag);
    for (int i = 0; i < ans.size() - flag; i++) printf("%d ", ans[i]);
  }
  return 0;
}
