#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100010];
vector<int> path;
bool sign[100010];
bool visited[100010];
void dfs(int node, int p) {
  if (visited[node]) return;
  visited[node] = true;
  path.push_back(node);
  sign[node] = !sign[node];
  for (int i = 0; i < adj[node].size(); i++) {
    dfs(adj[node][i], node);
  }
  if (p == -1) {
    if (sign[node]) {
      path.pop_back();
      sign[node] = !sign[node];
    }
    return;
  }
  if (sign[node]) {
    path.push_back(p);
    path.push_back(node);
    sign[node] = !sign[node];
    sign[p] = !sign[p];
  }
  sign[p] = !sign[p];
  path.push_back(p);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  int start = -1;
  for (int i = 1; i <= n; i++) {
    int par;
    scanf("%d", &par);
    sign[i] = par;
    if (sign[i]) start = i;
    visited[i] = false;
  }
  if (start == -1) {
    printf("0\n");
  } else {
    dfs(start, -1);
    bool ok = true;
    for (int i = 1; i <= n; i++) {
      if (sign[i]) ok = false;
    }
    if (ok) {
      printf("%d\n", path.size());
      for (int i = 0; i < path.size(); i++) {
        if (i) printf(" ");
        printf("%d", path[i]);
      }
      if (path.size()) printf("\n");
    } else {
      printf("-1\n");
    }
  }
  return 0;
}
