#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e6 + 3;
long long INF = 1e16;
long long n, m, ans, k, q, root;
int visited[MAXN], td[MAXN];
vector<int> g[MAXN];
vector<int> walk;
bool dfs(int d) {
  visited[d] = 1;
  int t = 1;
  walk.push_back(d);
  for (int u : g[d]) {
    bool ok;
    if (visited[u] == 0) {
      ok = dfs(u);
      if (!ok) {
        walk.push_back(d);
        walk.push_back(u);
        walk.push_back(d);
        t += 2;
      } else {
        walk.push_back(d);
        t++;
      }
    }
  }
  if (d == root) {
    if (t % 2 != td[d] % 2) {
      walk.pop_back();
    }
    return true;
  }
  if (t % 2 == td[d] % 2) {
    return true;
  }
  return false;
}
int main() {
  cin >> n >> m;
  root = 0;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    cin >> td[i];
    if (td[i] == 1) root = i;
  }
  if (root != 0) {
    dfs(root);
  }
  for (int i = 0; i < walk.size(); i++) {
    td[walk[i]] ^= 1;
  }
  for (int i = 1; i <= n; i++) {
    if (td[i] == 1) return cout << -1, 0;
  }
  cout << walk.size() << endl;
  for (int i = 0; i < walk.size(); i++) cout << walk[i] << " ";
  return 0;
}
