#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<vector<int> > g(N, vector<int>());
int odd[N];
int visited[N];
int counts[N];
vector<int> path;
void dfs(int i, int p) {
  visited[i] = 1;
  path.push_back(i);
  counts[i]++;
  for (int j = 0; j < g[i].size(); ++j) {
    if (!visited[g[i][j]]) {
      dfs(g[i][j], i);
      path.push_back(i);
      counts[i]++;
    }
  }
  if (counts[i] % 2 != odd[i]) {
    if (p != -1) {
      path.push_back(p);
      counts[p]++;
      path.push_back(i);
      counts[i]++;
    } else {
      path.erase(path.end() - 1);
    }
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) g[i].resize(0);
  int x, y;
  for (int i = 0; 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];
  int i = 1;
  while (!odd[i] && i <= n) ++i;
  if (i == n + 1) {
    cout << 0 << endl;
    return 0;
  }
  memset(visited, 0, sizeof(visited));
  memset(counts, 0, sizeof(counts));
  dfs(i, -1);
  for (int i = 1; i <= n; ++i)
    if (!visited[i] && odd[i]) {
      cout << -1 << endl;
      return 0;
    }
  cout << path.size() << endl;
  for (vector<int>::iterator it = path.begin(); it != path.end(); ++it)
    cout << *it << " ";
  cout << endl;
  return 0;
}
