#include <bits/stdc++.h>
using namespace std;
const int Dim = 1e5 + 5;
int n, m, x, y, ok, nri, pos;
int c[Dim], odd[Dim];
vector<int> ans, G[Dim];
void dfs(int node) {
  c[node] = 1;
  if (odd[node]) ok = 0;
  for (vector<int>::iterator it = G[node].begin(); it != G[node].end(); ++it) {
    if (c[*it] == 0) {
      dfs(*it);
    }
  }
}
void solve(int node, int tata) {
  c[node] = 1;
  ans.push_back(node);
  odd[node] = 1 - odd[node];
  for (vector<int>::iterator it = G[node].begin(); it != G[node].end(); ++it) {
    if (c[*it] == 0) {
      solve(*it, node);
      ans.push_back(node);
      odd[node] = 1 - odd[node];
    }
  }
  if (odd[node] && tata != -1) {
    ans.push_back(tata);
    odd[tata] = 1 - odd[tata];
    ans.push_back(node);
    odd[node] = 1 - odd[node];
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> x >> y;
    G[x].push_back(y);
    G[y].push_back(x);
  }
  for (int i = 1; i <= n; ++i) {
    cin >> odd[i];
  }
  for (int i = 1; i <= n; ++i) {
    if (c[i] == 0) {
      ok = 1;
      dfs(i);
      if (!ok) {
        ++nri;
        if (nri > 1) {
          cout << -1;
          return 0;
        }
        pos = i;
      }
    }
  }
  if (nri == 0) {
    cout << 0;
    return 0;
  }
  memset(c, 0, sizeof(c));
  solve(pos, -1);
  if (odd[pos] == 1) {
    ans.pop_back();
  }
  cout << ans.size() << '\n';
  for (int i = ans.size() - 1; i >= 0; --i) {
    cout << ans[i] << " ";
  }
  return 0;
}
