#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > links;
vector<char> isodd;
void solve() {
  int n, m;
  cin >> n >> m;
  links.resize(n);
  isodd.resize(n, false);
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    links[u - 1].push_back(v - 1);
    links[v - 1].push_back(u - 1);
  }
  int start = -1, odds = 0;
  int temp;
  for (int i = 0; i < n; ++i) {
    cin >> temp;
    if (temp > 0) isodd[i] = true;
    if (isodd[i]) {
      odds += 1;
      start = i;
    }
  }
  if (start == -1) {
    cout << 0;
    return;
  }
  vector<int> dive(1, start), link(1, 0);
  vector<char> down;
  vector<int> path;
  vector<char> vis(n, false);
  vis[start] = true;
  vis[start] = true;
  while (dive.size() > 0) {
    int cur = dive.back();
    if (link.back() >= (int)links[cur].size()) {
      path.push_back(cur);
      down.push_back(false);
      dive.pop_back();
      link.pop_back();
      if (isodd[cur]) odds -= 1;
      continue;
    }
    int j = links[cur][link.back()];
    link.back() += 1;
    if (!vis[j]) {
      vis[j] = true;
      path.push_back(cur);
      down.push_back(true);
      dive.push_back(j);
      link.push_back(0);
    }
  }
  if (odds > 0) {
    cout << -1;
    return;
  }
  vector<int> res;
  for (int i = 0; i < (int)path.size() - 1; ++i) {
    int cur = path[i];
    if (down[i]) {
      res.push_back(cur);
      isodd[cur] = !isodd[cur];
    } else {
      if (isodd[cur]) {
        res.push_back(cur);
      } else {
        res.push_back(cur);
        res.push_back(path[i + 1]);
        isodd[path[i + 1]] = !isodd[path[i + 1]];
        res.push_back(cur);
      }
    }
  }
  if (isodd[start]) {
    res.push_back(path.back());
  }
  cout << res.size() << endl;
  for (int i = 0; i < (int)res.size(); ++i) {
    cout << res[i] + 1 << " ";
  }
}
int main() {
  solve();
  return 0;
}
