#include <bits/stdc++.h>
using namespace std;
const double g = 10.0, eps = 1e-12;
const int N = 100000 + 10, maxn = 2000 + 10, inf = 0x3f3f3f3f;
vector<int> v[N];
int a[N], te[N];
bool vis[N];
queue<int> s;
void dfs(int u, int f, int root) {
  te[u] ^= 1;
  s.push(u);
  vis[u] = 1;
  for (int i = 0; i < v[u].size(); i++) {
    int x = v[u][i];
    if (!vis[x]) dfs(x, u, root);
  }
  if (u != root) {
    if (te[u] != a[u]) {
      te[u] ^= 1;
      s.push(f);
      s.push(u);
      s.push(f);
    } else {
      te[f] ^= 1;
      s.push(f);
    }
  } else {
    if (te[u] != a[u]) {
      if (v[root].size() == 0) {
        puts("-1");
        exit(0);
      }
      te[u] ^= 1;
      s.push(v[root][0]);
      s.push(root);
      s.push(v[root][0]);
    }
  }
}
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);
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int tot = 0;
  for (int i = 1; i <= n; i++) {
    if (!vis[i] && a[i]) {
      dfs(i, -1, i);
      tot++;
    }
  }
  if (tot == 0)
    puts("0");
  else if (tot > 1)
    puts("-1");
  else {
    printf("%d\n", s.size());
    while (!s.empty()) {
      printf("%d ", s.front());
      s.pop();
    }
  }
  return 0;
}
