#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, fa[maxn], m;
vector<int> G[maxn], ans;
int Fd(int x) {
  if (!fa[x]) return x;
  return fa[x] = Fd(fa[x]);
}
int vis[maxn], a[maxn];
void dfs(int u, int f) {
  ans.push_back(u);
  vis[u] ^= 1;
  for (auto v : G[u])
    if (v != f) {
      dfs(v, u);
      ans.push_back(u);
      vis[u] ^= 1;
    }
  if (vis[u] != a[u]) {
    ans.push_back(f);
    vis[f] ^= 1;
    ans.push_back(u);
    vis[u] ^= 1;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1, u, v; i <= m; ++i) {
    scanf("%d%d", &u, &v);
    if (Fd(u) != Fd(v)) {
      G[u].push_back(v);
      G[v].push_back(u);
      fa[Fd(u)] = Fd(v);
    }
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%d", a + i);
  }
  int tot = 0, st = 1;
  for (int i = 1; i <= n; ++i) {
    if (a[i]) {
      st = Fd(i);
      if (!vis[st]) {
        vis[st] = 1;
        ++tot;
      }
    }
  }
  memset(vis, 0, sizeof vis);
  if (tot > 1) {
    puts("-1");
    exit(0);
  }
  dfs(st, 0);
  if (ans.size() >= 3 && ans[ans.size() - 2] == 0) {
    vector<int>::iterator it;
    it = ans.end();
    it--;
    it = ans.erase(it);
    it--;
    it = ans.erase(it);
    it--;
    it = ans.erase(it);
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); ++i) {
    printf("%d ", ans[i]);
  }
  return 0;
}
