#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> parity;
vector<vector<int> > adj;
vector<vector<int> > children;
vector<bool> seen;
bool mktree(int node) {
  seen[node] = true;
  bool ret = parity[node] == 1;
  for (int i = 0; i < adj[node].size(); i++) {
    int neigh = adj[node][i];
    if (seen[neigh]) continue;
    children[node].push_back(neigh);
    ret = mktree(neigh) || ret;
  }
  return ret;
}
void subtree(int root, vector<int> &path) {
  for (int i = 0; i < children[root].size(); i++) {
    int child = children[root][i];
    path.push_back(child);
    (parity[child] ^= 1);
    subtree(child, path);
    path.push_back(root);
    (parity[root] ^= 1);
    if (parity[child]) {
      path.push_back(child);
      (parity[child] ^= 1);
      path.push_back(root);
      (parity[root] ^= 1);
    }
  }
}
int main() {
  cin >> n >> m;
  adj.assign(n, vector<int>());
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a -= 1;
    b -= 1;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  parity.assign(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> parity[i];
  }
  seen.assign(n, false);
  children.assign(n, vector<int>());
  vector<int> parity1;
  for (int i = 0; i < n; i++) {
    if (seen[i]) continue;
    if (mktree(i)) parity1.push_back(i);
  }
  if (parity1.size() > 1) {
    printf("-1\n");
    return 0;
  }
  if (parity1.size() == 0) {
    printf("0\n");
    return 0;
  }
  int root = parity1[0];
  vector<int> path;
  path.push_back(root);
  (parity[root] ^= 1);
  subtree(root, path);
  if (parity[root]) {
    path.pop_back();
  }
  printf("%lu\n", path.size());
  for (int i = 0; i < path.size(); i++) {
    printf("%d", path[i] + 1);
    if (i != path.size() - 1) putchar(' ');
  }
  putchar('\n');
  return 0;
}
