#include <bits/stdc++.h>
using namespace std;
vector<int> G[100005], ans, one, tmp;
int n, m;
int a[100005], st, dis[100005], pre[100005];
void go(int u, int v, vector<int>& x) {
  x.push_back(v);
  while (1) {
    v = pre[v];
    x.push_back(v);
    if (v == u) return;
  }
}
int vis[100005], hehe[100005];
void dfs(int u, int fa) {
  hehe[u] = fa;
  ans.push_back(u);
  vis[u] ^= 1;
  for (int i = 0; i < G[u].size(); i++)
    if (hehe[G[u][i]] == 0) {
      dfs(G[u][i], u);
      if (a[G[u][i]] != vis[G[u][i]]) {
        ans.push_back(u);
        ans.push_back(G[u][i]);
        vis[G[u][i]] ^= 1;
        vis[u] ^= 1;
      }
      if (ans[ans.size() - 1] != u) {
        ans.push_back(u);
        vis[u] ^= 1;
      }
    }
}
void input() {
  one.clear();
  for (int i = 0; i <= n; i++) G[i].clear();
  while (m--) {
    int u, v;
    scanf("%d %d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  st = -1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i]) {
      if (st == -1) st = i;
      one.push_back(i);
    }
  }
}
int main() {
  int i, j, u, v;
  while (~scanf("%d %d", &n, &m)) {
    input();
    if (st == -1) {
      puts("0");
      continue;
    }
    if (one.size() == 1) {
      printf("1\n%d\n", st);
      continue;
    }
    ans.clear();
    memset(vis, 0, sizeof vis);
    memset(hehe, 0, sizeof hehe);
    hehe[st] = st;
    dfs(st, st);
    if (a[st] != vis[st]) {
      ans.push_back(G[st][0]);
      ans.push_back(st);
      ans.push_back(G[st][0]);
    }
    bool ok = false;
    for (i = 1; i <= n; i++)
      if (a[i] && hehe[i] == 0) ok = true;
    if (ok) {
      puts("-1");
      continue;
    }
    printf("%d\n", ans.size());
    for (i = 0; i < ans.size(); i++) printf("%d ", ans[i]);
    puts("");
  }
  return 0;
}
