#include <bits/stdc++.h>
using namespace std;
vector<int> graph[100010];
int par[100010], pt[100010], visited[100010], mk = 0, pr[100010];
vector<int> path;
vector<int> re;
void dfs(int s) {
  re.push_back(s);
  visited[s] = 1;
  if (par[s]) mk = 1;
  for (auto x : graph[s]) {
    if (!visited[x]) dfs(x);
  }
}
void dfs2(int s, int p) {
  visited[s] = 1;
  path.push_back(s);
  par[s] ^= 1;
  for (auto x : graph[s]) {
    if (!visited[x]) {
      dfs2(x, s);
      path.push_back(s);
      par[s] ^= 1;
    }
  }
  if (par[s] && p != -1) {
    path.push_back(p);
    path.push_back(s);
    par[s] ^= 1;
    par[p] ^= 1;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    graph[x - 1].push_back(y - 1);
    graph[y - 1].push_back(x - 1);
  }
  for (int i = 0; i < n; i++) cin >> par[i];
  int ct = 0;
  for (int i = 0; i < n; i++) {
    if (!visited[i]) {
      mk = 0;
      dfs(i);
      if (mk) {
        for (auto x : re) pr[x] = 1;
      }
      re.clear();
      ct += mk;
    }
  }
  if (ct >= 2) {
    cout << -1 << '\n';
    return 0;
  }
  memset(visited, 0, sizeof(visited));
  for (int i = 0; i < n; i++) {
    if (!visited[i] && pr[i]) {
      dfs2(i, -1);
      if (par[i]) path.pop_back();
      break;
    }
  }
  cout << path.size() << '\n';
  for (int i = 0; i < path.size(); i++) cout << path[i] + 1 << " ";
  cout << '\n';
}
