#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
bool flags[MAXN];
bool used[MAXN];
vector<vector<int> > g;
vector<int> path;
void dfs(int v, int p) {
  int i;
  used[v] = true;
  path.push_back(v);
  flags[v] ^= 1;
  for (i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (!used[to]) {
      dfs(to, v);
      path.push_back(v);
      flags[v] ^= 1;
    }
  }
  if (flags[v]) {
    if (p == -1) {
      path.pop_back();
    } else {
      path.push_back(p);
      flags[p] ^= 1;
      path.push_back(v);
    }
    flags[v] = 0;
  }
}
int main() {
  int i;
  int N, M;
  cin >> N >> M;
  g.assign(N, vector<int>());
  for (i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (i = 0; i < N; i++) {
    cin >> flags[i];
    used[i] = false;
  }
  for (i = 0; i < N; i++) {
    if (flags[i] && !used[i]) {
      dfs(i, -1);
      break;
    }
  }
  for (i = 0; i < N; i++)
    if (flags[i]) break;
  if (i < N) {
    cout << "-1";
  } else {
    cout << path.size() << endl;
    for (i = 0; i < path.size(); i++) cout << (path[i] + 1) << " ";
  }
  cout << endl;
}
