#include <bits/stdc++.h>
using namespace std;
int vis[100001];
int cntvis[100001];
vector<int> g[100001];
int par[100001];
vector<int> ans;
int dfs(int curn) {
  vis[curn] = 1;
  int ret = par[curn];
  for (int i : g[curn]) {
    if (!vis[i]) ret += dfs(i);
  }
  return ret;
}
void dfs2(int curn, int parent = -1) {
  vis[curn] = 1;
  cntvis[curn]++;
  ans.push_back(curn);
  for (int i : g[curn]) {
    if (!vis[i]) dfs2(i, curn);
  }
  if (parent != -1 and (cntvis[curn] & 1) != par[curn]) {
    ans.push_back(parent);
    ans.push_back(curn);
    cntvis[parent]++;
    cntvis[curn]++;
  }
  if (parent != -1) {
    ans.push_back(parent);
    cntvis[parent]++;
  }
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (int i = 0; i < n; i++) {
    cin >> par[i];
  }
  int cnt = 0;
  int last = 0;
  for (int i = 0; i < n; i++) {
    if (!vis[i]) {
      if (dfs(i)) {
        cnt++;
        last = i;
      }
    }
  }
  if (cnt > 1) {
    cout << -1 << "\n";
    return 0;
  }
  memset(vis, 0, sizeof vis);
  dfs2(last);
  if (par[last] != (cntvis[last] & 1)) {
    ans.pop_back();
  }
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] + 1 << " ";
  }
  cout << "\n";
  return 0;
}
