#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int flag, n, m, x[N], num[N], vis[N], ans[4 * N], tot;
vector<int> V[N];
void add(int u, int v) { V[u].push_back(v); }
int dfs(int u, int fa = 0) {
  vis[u] = 1;
  int ret = x[u];
  for (int i = 0; i < V[u].size(); ++i) {
    int v = V[u][i];
    if (v == fa) continue;
    if (!vis[v] && dfs(v, u)) ret = 1;
  }
  return ret;
}
void DFS(int u, int fa = 0) {
  vis[u] = 1;
  for (int i = 0; i < V[u].size(); ++i) {
    int v = V[u][i];
    if (v == fa) continue;
    if (!vis[v]) {
      ans[tot++] = v;
      num[v] ^= 1;
      DFS(v, u);
      ans[tot++] = u;
      num[u] ^= 1;
    }
  }
  if (num[u] != x[u] && fa) {
    ans[tot++] = fa;
    ans[tot++] = u;
    num[fa] ^= 1;
  }
}
void solve(int s) {
  memset(vis, 0, sizeof(vis));
  DFS(s);
  if (num[s] != x[s]) {
    printf("%d\n%d ", tot + 1, s);
  } else
    printf("%d\n", tot);
  for (int i = 0; i < tot; ++i) printf("%d ", ans[i]);
  printf("\n");
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%d", x + i);
  }
  int flag = 0;
  for (int i = 1; i <= n; ++i) {
    if (!vis[i]) {
      if (dfs(i)) {
        if (flag) {
          printf("-1\n");
          exit(0);
        }
        flag = i;
      }
    }
  }
  if (flag)
    solve(flag);
  else
    printf("0\n");
  return 0;
}
