#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
const int N = 100100;
int a[N], b[N], p[N];
int f(int x) { return x == p[x] ? x : p[x] = f(p[x]); }
vector<int> g[N];
void dfs(int u, int fa) {
  ans.push_back(u);
  b[u] ^= 1;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (v == fa) continue;
    dfs(v, u);
    ans.push_back(u);
    b[u] ^= 1;
  }
  if (b[u] != a[u]) {
    if (fa) {
      ans.push_back(fa);
      b[fa] ^= 1;
      ans.push_back(u);
      b[u] ^= 1;
    } else {
      ans.pop_back();
      b[u] ^= 1;
    }
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) p[i] = i;
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    int fx = f(x), fy = f(y);
    if (fx != fy) {
      p[fx] = fy;
      g[x].push_back(y);
      g[y].push_back(x);
    }
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  bool s = false;
  for (int i = 1; i <= n; i++) {
    if (a[i]) {
      dfs(i, 0);
      s = true;
      break;
    }
  }
  if (!s) {
    puts("0");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (b[i] != a[i]) {
      s = false;
      break;
    }
  }
  if (!s) {
    puts("-1");
    return 0;
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
