#include <bits/stdc++.h>
using namespace std;
vector<int> g[100005];
vector<int> path;
int parity[100005];
int used[100005];
void DFS(int node, int p) {
  int viz;
  used[node] = 1;
  parity[node] = 1 - parity[node];
  path.push_back(node);
  for (int i = 0; i < (int)g[node].size(); i++) {
    viz = g[node][i];
    if (!used[viz]) {
      DFS(viz, node);
    }
  }
  if (parity[node] == 1 && p != -1) {
    path.push_back(p);
    path.push_back(node);
    parity[p] = 1 - parity[p];
    parity[node] = 0;
  }
  if (p != -1) {
    path.push_back(p);
    parity[p] = 1 - parity[p];
  }
  return;
}
int main(void) {
  int n, m;
  int u, v;
  int ok;
  scanf(" %d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf(" %d %d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    used[i] = 0;
    scanf(" %d", &parity[i]);
  }
  for (int i = 1; i <= n; i++) {
    if (parity[i] == 1) {
      DFS(i, -1);
      if (parity[i] == 1) {
        path.pop_back();
        parity[i] = 0;
      }
      break;
    }
  }
  ok = 1;
  for (int i = 1; i <= n; i++) {
    if (parity[i] == 1) {
      ok = 0;
      break;
    }
  }
  if (ok) {
    printf("%d\n", (int)path.size());
    for (int i = 0; i < (int)path.size(); i++) {
      if (i != 0) {
        printf(" ");
      }
      printf("%d", path[i]);
    }
    printf("\n");
  } else {
    printf("-1\n");
  }
  return 0;
}
