#include <bits/stdc++.h>
using namespace std;
vector<int> G[100001];
int ans[400001];
bool vis[100001], parity[100001];
int pos;
void visit(int x) {
  ans[pos++] = x;
  parity[x] ^= 1;
}
void dfs(int x) {
  vis[x] = 1;
  visit(x);
  for (int i = 0; i < G[x].size(); i++) {
    if (vis[G[x][i]]) continue;
    dfs(G[x][i]);
    visit(x);
    if (parity[G[x][i]]) {
      visit(G[x][i]);
      visit(x);
    }
  }
}
bool judge(int n) {
  for (int i = 1; i <= n; i++)
    if (parity[i]) return false;
  return true;
}
int main() {
  int n, m, u, v;
  pos = 0;
  memset(vis, 0, sizeof(vis));
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  int start = -1;
  for (int i = 1; i <= n; i++) {
    cin >> u;
    parity[i] = u;
    if (start == -1 && u) start = i;
  }
  dfs(start);
  if (parity[start]) {
    parity[start] = 0;
    pos--;
  }
  if (judge(n)) {
    cout << pos << endl;
    for (int i = 0; i < pos; i++) cout << ans[i] << " ";
    cout << endl;
  } else
    cout << -1 << endl;
  return 0;
}
