#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, m, a[N], step[N << 2], cnt, x, y, r, s, l, root, sz;
vector<int> V[N];
bool vis[N], sign[N << 2];
void dfs(int v, int par) {
  vis[v] = 1;
  step[++cnt] = v;
  for (int i = 0; i < V[v].size(); i++) {
    int vv = V[v][i];
    if (vis[vv])
      continue;
    else {
      dfs(vv, v);
      step[++cnt] = v;
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  while (m--) {
    scanf("%d%d", &x, &y);
    V[x].push_back(y);
    V[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i]) root = i;
  }
  if (!root) {
    puts("0");
    return 0;
  }
  dfs(root, 0);
  for (int i = 1; i <= n; i++) {
    if (!vis[i] && a[i]) {
      puts("-1");
      return 0;
    }
  }
  x = 0;
  for (int i = 1; i <= cnt; i++) a[step[i]] ^= 1;
  for (int i = 1; i <= n; i++) l += a[i];
  if (l % 2) {
    a[step[cnt]] ^= 1;
    cnt--;
  }
  for (int i = 1; i <= cnt; i++) {
    if (a[step[i]]) {
      if (!x) {
        x = i;
        a[step[i]] = 0;
      } else {
        y = i;
        for (i = x; i < y; i++) sign[i] = 1;
        a[step[i]] = 0;
        x = 0;
      }
    } else if (x && step[x] == step[i])
      x = i;
  }
  for (int i = 1; i < cnt; i++) {
    if (sign[i])
      sz += 3;
    else
      sz++;
  }
  sz++;
  printf("%d\n", sz);
  for (int i = 1; i < cnt; i++) {
    if (sign[i])
      printf("%d %d %d ", step[i], step[i + 1], step[i]);
    else
      printf("%d ", step[i]);
  }
  printf("%d", step[cnt]);
}
