#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
vector<int> adj[N], path;
bool vis[N];
int n, m, x[N], par[N];
void add_to_path(int v) {
  path.push_back(v);
  x[v] = 1 - x[v];
}
void dfs(int v) {
  vis[v] = true;
  add_to_path(v);
  for (int i = 0; i < (int)adj[v].size(); i++)
    if (!vis[adj[v][i]]) {
      par[adj[v][i]] = v;
      dfs(adj[v][i]);
      add_to_path(v);
    }
  if (x[v] == 1 && par[v] != -1) {
    add_to_path(par[v]);
    add_to_path(v);
  }
}
int main() {
  int u, v;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x[i]);
    par[i] = -1, vis[i] = false;
  }
  int ver = 0;
  for (int i = 1; i <= n; i++)
    if (x[i]) {
      ver = i;
      break;
    }
  if (ver) dfs(ver);
  if (x[ver]) {
    path.pop_back();
    x[ver] = 0;
  }
  for (int i = 1; i <= n; i++)
    if (x[i] > 0) {
      cout << -1 << '\n';
      return 0;
    }
  printf("%d\n", (int)path.size());
  for (int i = 0; i < (int)path.size(); i++) cout << path[i] << " ";
  return 0;
}
