#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > g;
int even[1 << 17];
bool used[1 << 17];
vector<int> path;
void addV(int v) {
  path.push_back(v + 1);
  even[v] ^= 1;
}
void dfs(int v, int p) {
  used[v] = true;
  addV(v);
  for (int i(0); i <= ((long long)(((int)g[v].size())) - 1); ++i) {
    int to(g[v][i]);
    if (to == p) continue;
    if (!used[to]) {
      dfs(to, v);
      addV(v);
    }
  }
  if (even[v]) {
    if (p == v) {
      path.pop_back();
    } else {
      addV(p);
      addV(v);
    }
  }
}
void solve() {
  int n, m;
  scanf("%d%d", &n, &m);
  g.resize(n);
  for (int i(0); i <= ((long long)(m)-1); ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    --a, --b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (int i(0); i <= ((long long)(n)-1); ++i) scanf("%d", &even[i]);
  bool ok(false);
  for (int i(0); i <= ((long long)(n)-1); ++i) {
    if (!used[i]) {
      if (even[i] && ok) {
        puts("-1");
        return;
      }
      if (even[i]) {
        dfs(i, i);
        ok = true;
      }
    }
  }
  printf("%d\n", ((int)path.size()));
  for (int i(0); i <= ((long long)(((int)path.size())) - 1); ++i)
    printf("%d%c", path[i], i + 1 == ((int)path.size()) ? '\n' : ' ');
}
int main() {
  solve();
  return 0;
}
