#include <bits/stdc++.h>
using namespace std;
int val[100010];
vector<int> qe[100010], ans;
int head[100010], next1[100010 * 2], to[100010 * 2];
int fa[100010], top, vi[100010], root, cnt;
int find(int x) {
  if (x != fa[x]) fa[x] = find(fa[x]);
  return fa[x];
}
void Unit(int u, int v) {
  next1[top] = head[u];
  to[top] = v;
  head[u] = top++;
}
void dfs1(int u) {
  vi[u] = 1;
  if (val[u]) cnt++;
  for (int i = head[u]; i != -1; i = next1[i]) {
    int v = to[i];
    if (vi[v]) continue;
    dfs1(v);
    qe[u].push_back(v);
    qe[v].push_back(u);
  }
}
void dfs(int u, int fa) {
  ans.push_back(u);
  vi[u]++;
  vi[u] %= 2;
  for (int i = 0; i < qe[u].size(); i++) {
    int v = qe[u][i];
    if (v == fa) continue;
    dfs(v, u);
    if (vi[v] ^ val[v]) {
      ans.push_back(u);
      vi[u]++;
      vi[u] %= 2;
      ans.push_back(v);
    }
    ans.push_back(u);
    vi[u]++;
    vi[u] %= 2;
  }
}
int main() {
  int i, j, n, m, k;
  int u, v;
  while (cin >> n >> m) {
    for (i = 0; i <= n; i++) {
      fa[i] = i;
      qe[i].clear();
    }
    memset(head, -1, sizeof(head));
    memset(vi, 0, sizeof(vi));
    ans.clear();
    top = 0;
    while (m--) {
      scanf("%d%d", &u, &v);
      Unit(u, v);
      Unit(v, u);
    }
    for (i = 1; i <= n; i++) scanf("%d", &val[i]);
    k = 0;
    for (i = 1; i <= n; i++)
      if (!vi[i]) {
        cnt = 0;
        dfs1(i);
        if (cnt > 0) root = i;
        if (cnt > 0) k++;
      }
    if (k > 1) {
      puts("-1");
      continue;
    }
    if (k == 0) {
      puts("0");
      continue;
    }
    memset(vi, 0, sizeof(vi));
    dfs(root, -1);
    if (vi[root] ^ val[root]) {
      u = root;
      v = qe[u][0];
      ans.push_back(v);
      ans.push_back(u);
      ans.push_back(v);
    }
    n = ans.size();
    printf("%d\n", n);
    for (i = 0; i < n; i++) printf("%d ", ans[i]);
    puts("");
  }
  return 0;
}
