#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 100000000;
int fastMin(int x, int y) { return (((y - x) >> (32 - 1)) & (x ^ y)) ^ x; }
int fastMax(int x, int y) { return (((y - x) >> (32 - 1)) & (x ^ y)) ^ y; }
long long fastMin(long long x, long long y) {
  return (((y - x) >> (64 - 1)) & (x ^ y)) ^ x;
}
long long fastMax(long long x, long long y) {
  return (((y - x) >> (64 - 1)) & (x ^ y)) ^ y;
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
class UnionFind {
  int n;
  vector<int> par;
  vector<int> rank;

 public:
  UnionFind() {}
  UnionFind(int size) { reset(size); }
  void reset(int size) {
    n = size;
    par.resize(size);
    rank.resize(size);
    for (int i = 0; i < size; i++) par[i] = i, rank[i] = 0;
  }
  int find(int x) {
    if (par[x] == x) return x;
    return par[x] = find(par[x]);
  }
  void unite(int x, int y) {
    x = find(x), y = find(y);
    if (x == y) return;
    if (rank[x] < rank[y]) {
      par[x] = y;
    } else {
      par[y] = x;
      if (rank[x] == rank[y]) rank[x]++;
    }
    n--;
  }
  bool same(int x, int y) { return find(x) == find(y); }
  int size() { return n; }
};
int n, m;
UnionFind uf;
vector<int> e1[((int)1e5)];
int x[((int)1e5)];
int check() {
  int par_id = -1;
  for (int i = 0; i < (n); i++) {
    if (x[i]) {
      int se = uf.find(i);
      if (par_id != -1 && par_id != se) return -2;
      par_id = se;
    }
  }
  return par_id;
}
vector<int> e2[((int)1e5)];
bool used1[((int)1e5)];
bool child_colored[((int)1e5)];
bool dfs1(int par, int v) {
  used1[v] = true;
  if (par != -1) e2[par].push_back(v);
  bool ret = (x[v] == 1);
  for (auto p : e1[v]) {
    if (used1[p]) continue;
    ret |= dfs1(v, p);
  }
  return child_colored[v] = ret;
}
vector<int> ans;
bool dfs2(int par, int v) {
  int cnt = 0;
  ans.push_back(v);
  cnt++;
  for (auto p : e2[v]) {
    if (!child_colored[p]) continue;
    bool val = dfs2(v, p);
    ans.push_back(v);
    cnt++;
    if (val) {
      ans.push_back(p);
      ans.push_back(v);
      cnt++;
    }
  }
  if ((cnt & 1) ^ x[v])
    return true;
  else
    return false;
}
void solve(int root) {
  dfs1(-1, root);
  bool root_b = dfs2(-1, root);
  if (root_b) ans.pop_back();
}
int main() {
  scanf("%d%d", &n, &m);
  uf.reset(n);
  for (int i = 0; i < (m); i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--;
    v--;
    uf.unite(u, v);
    e1[u].push_back(v);
    e1[v].push_back(u);
  }
  for (int i = 0; i < (n); i++) {
    scanf("%d", x + i);
  }
  int root = check();
  if (root == -2) {
    puts("-1");
  } else if (root == -1) {
    puts("0");
  } else {
    solve(root);
    printf("%d\n", ((int)(ans).size()));
    for (int i = 0; i < (((int)(ans).size())); i++) {
      printf("%d%c", ans[i] + 1, ((int)(ans).size()) == i + 1 ? '\n' : ' ');
    }
  }
}
