#include <bits/stdc++.h>
using namespace std;
int N, M;
int id[200005];
int par[200005];
int vis[200005];
vector<int> ans;
vector<int> ady[200005];
void dfs(int x, int p) {
  vis[x] ^= 1;
  ans.push_back(x);
  for (auto v : ady[x])
    if (v != p) {
      dfs(v, x);
      ans.push_back(x);
      vis[x] ^= 1;
    }
  if (vis[x] != par[x]) {
    if (p == 0) {
      ans.pop_back();
      vis[x] ^= 1;
      return;
    }
    ans.push_back(p);
    ans.push_back(x);
    vis[x] ^= 1;
    vis[p] ^= 1;
  }
}
int find(int x) {
  if (x == id[x]) return x;
  return id[x] = find(id[x]);
}
void join(int a, int b) {
  int ga = find(a);
  int gb = find(b);
  if (ga == gb) return;
  id[ga] = gb;
  ady[a].push_back(b);
  ady[b].push_back(a);
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> N >> M;
  for (int i = 1; i <= N; i++) id[i] = i;
  for (int i = 1; i <= M; i++) {
    int u, v;
    cin >> u >> v;
    join(u, v);
  }
  int idx = -1;
  for (int i = 1; i <= N; i++) {
    cin >> par[i];
    if (par[i] & 1) idx = i;
  }
  if (idx == -1) {
    cout << "0\n";
    return 0;
  }
  dfs(idx, 0);
  bool ok = true;
  for (int i = 1; i <= N; i++)
    if (par[i] != vis[i]) ok = 0;
  if (!ok) {
    cout << "-1\n";
    return 0;
  }
  cout << ans.size() << "\n";
  for (auto i : ans) cout << i << " ";
  return 0;
}
