#include <bits/stdc++.h>
using namespace std;
int n, m, idx;
int state[100010];
bool vis[100010];
vector<int> g[100010], ans;
void dfs(int xp) {
  int i;
  ans.push_back(xp);
  state[xp] = 1 - state[xp];
  vis[xp] = true;
  for (i = 0; i < g[xp].size(); i++)
    if (!vis[g[xp][i]]) {
      dfs(g[xp][i]);
      ans.push_back(xp);
      state[xp] = 1 - state[xp];
      if (state[g[xp][i]]) {
        ans.push_back(g[xp][i]);
        state[g[xp][i]] = 1 - state[g[xp][i]];
        ans.push_back(xp);
        state[xp] = 1 - state[xp];
      }
    }
}
void solve() {
  int i, j, dem;
  memset(vis, false, sizeof(vis));
  for (i = 1; i <= n; i++)
    if (state[i]) {
      dfs(i);
      if (state[i]) {
        ans.pop_back();
        state[i] = 1 - state[i];
      }
      break;
    }
  dem = 0;
  for (i = 1; i <= n; i++) dem += state[i];
  if (dem != 0) {
    printf("-1\n");
    return;
  }
  cout << ans.size() << endl;
  for (i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  printf("\n");
}
void input() {
  int i, x, y;
  scanf("%d %d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d %d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (i = 1; i <= n; i++) scanf("%d", &state[i]);
  solve();
}
int main() {
  input();
  fclose(stdin);
  fclose(stdout);
  return 0;
}
