#include <bits/stdc++.h>
using namespace std;
const int maxn = 100100;
vector<int> G[maxn], ans;
int n, m, c[maxn];
bool vis[maxn];
void dfs(int u) {
  c[u] ^= 1;
  ans.push_back(u);
  vis[u] = true;
  for (int i = 0, sz = G[u].size(); i < sz; i++) {
    int v = G[u][i];
    if (vis[v]) continue;
    dfs(v);
    c[u] ^= 1;
    ans.push_back(u);
    if (c[v]) {
      c[v] ^= 1;
      ans.push_back(v);
      c[u] ^= 1;
      ans.push_back(u);
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  int root = -1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", c + i);
    if (c[i]) root = i;
  }
  if (root == -1) {
    puts("0");
    return 0;
  }
  dfs(root);
  if (c[root] == 1) {
    c[root] ^= 1;
    ans.pop_back();
  }
  bool flag = true;
  for (int i = 1; i <= n; i++) {
    if (c[i]) {
      flag = false;
      break;
    }
  }
  if (flag == true) {
    int sz = ans.size();
    printf("%d\n", sz);
    for (int i = 0; i < sz; i++) {
      printf("%d ", ans[i]);
    }
  } else
    puts("-1");
  return 0;
}
