#include <bits/stdc++.h>
using namespace std;
vector<int> graph[100100], ans, cur;
int total, parity[100100];
bool done[100100];
void solve(int node, int parent) {
  int i, child;
  done[node] = true;
  ans.push_back(node);
  parity[node] = 1 - parity[node];
  for (i = 0; i < graph[node].size(); i++) {
    child = graph[node][i];
    if (!done[child]) {
      solve(child, node);
      ans.push_back(node);
      parity[node] = 1 - parity[node];
    }
  }
  if (parity[node]) {
    ans.push_back(parent);
    ans.push_back(node);
    parity[node] = 1 - parity[node];
    parity[parent] = 1 - parity[parent];
  }
}
int main() {
  int i, j, k, n, m, x, y, prev;
  bool valid = true;
  cin >> n;
  cin >> m;
  for (i = 0; i < m; i++) {
    cin >> x >> y;
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
  for (i = 0; i < n; i++) {
    cin >> x;
    parity[i + 1] = x;
  }
  memset(done, false, sizeof(done));
  prev = 0;
  for (i = 1; i <= n; i++) {
    if (!done[i] && parity[i]) {
      total = 0;
      solve(i, i);
      if (ans.size() - prev != 0) {
        if (valid) {
          valid = false;
          prev = ans.size();
        } else {
          cout << -1;
          return 0;
        }
      }
    }
  }
  if (ans.size() && parity[ans[0]]) {
    ans.pop_back();
    ans.pop_back();
    ans.pop_back();
  }
  cout << ans.size() << endl;
  for (i = 0; i < ans.size(); i++) cout << ans[i] << " ";
}
