#include <bits/stdc++.h>
using namespace std;
int cnt;
const int N = 1e5 + 5;
vector<int> E[N];
int ans[N << 2], c[N];
bool vis[N];
inline void dfs(int u, int fa) {
  vis[u] = true;
  c[u] ^= 1;
  ans[++cnt] = u;
  for (int i = 0; i < (int)E[u].size(); ++i) {
    int v = E[u][i];
    if (v == fa || vis[v]) continue;
    dfs(v, u);
    ans[++cnt] = u;
    c[u] ^= 1;
  }
  if (c[u]) {
    ans[++cnt] = fa;
    ans[++cnt] = u;
    c[u] ^= 1;
    c[fa] ^= 1;
  }
}
int main() {
  int n = 0, m = 0, root = 0;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    int u = 0, v = 0;
    scanf("%d%d", &u, &v);
    E[u].push_back(v);
    E[v].push_back(u);
  }
  for (int i = 1; i <= n; ++i) scanf("%d", &c[i]);
  for (int i = 1; i <= n; ++i)
    if (c[i]) {
      root = i;
      dfs(root, 0);
      for (int j = 1; j <= n; ++j)
        if (c[j] && !vis[j]) return puts("-1"), 0;
      if (cnt > 1 && ans[cnt - 1] == 0) cnt -= 3;
      break;
    }
  printf("%d\n", cnt);
  for (int j = 1; j <= cnt; ++j) printf("%d ", ans[j]);
  putchar('\n');
  return 0;
}
