#include <bits/stdc++.h>
using namespace std;
const int MAXN(1e5 + 100);
int n, m, root;
bool ans;
vector<int> G[MAXN];
int p[MAXN], cnt[MAXN];
bool vis[MAXN];
vector<int> path;
void dfs(int v) {
  vis[v] = true;
  cnt[v]++;
  path.push_back(v);
  for (int i = 0; i < G[v].size(); i++) {
    int to = G[v][i];
    if (vis[to]) continue;
    dfs(to);
    cnt[v]++;
    path.push_back(v);
    if (cnt[to] % 2 != p[to]) {
      cnt[to]++;
      path.push_back(to);
      cnt[v]++;
      path.push_back(v);
    }
  }
}
void init() {
  scanf("%d%d", &n, &m);
  root = 1;
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
    if (p[i]) root = i;
  }
}
void solve() {
  dfs(root);
  ans = true;
  if (!path.empty() && (path.size() > 4 * n || cnt[root] % 2 != p[root]))
    path.pop_back(), cnt[root]--;
  for (int i = 1; i <= n; i++)
    if (cnt[i] % 2 != p[i]) {
      ans = false;
      break;
    }
  if (ans) {
    printf("%d\n", path.size());
    for (int i = 0; i < path.size(); i++)
      printf("%d%c", path[i], i == path.size() - 1 ? '\n' : ' ');
  } else
    printf("-1\n");
}
int main() {
  {
    init();
    solve();
  }
}
