#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1000000000")
using namespace std;
const bool db = false;
vector<int> gr[300010], have;
vector<vector<int> > comp;
int n, m, odd[300010];
int x, y, mark[300010];
int cnt[300010];
void dfs_c(int v, vector<int> &comp, int &o) {
  mark[v] = 1;
  o += odd[v];
  for (int i = 0, sz = gr[v].size(); i < sz; ++i) {
    int to = gr[v][i];
    if (mark[to] == 1) continue;
    dfs_c(to, comp, o);
  }
  comp.push_back(v);
}
void dfs_go(int v, int p, vector<int> &ans) {
  mark[v] = 0;
  ans.push_back(v);
  ++cnt[v];
  for (int i = 0, sz = gr[v].size(); i < sz; ++i) {
    int to = gr[v][i];
    if (mark[to] == 0) continue;
    dfs_go(to, v, ans);
    ans.push_back(v);
    ++cnt[v];
  }
  if (odd[v] != cnt[v] % 2) {
    if (p > 0) {
      ++cnt[p];
      ans.push_back(p);
      ++cnt[v];
      ans.push_back(v);
    } else {
      ans.pop_back();
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int it = 0; it < m; ++it) {
    scanf("%d%d", &x, &y);
    gr[x].push_back(y);
    gr[y].push_back(x);
  }
  for (int i = 1; i <= n; ++i) scanf("%d", &odd[i]);
  int cnt = 0, id = 0;
  for (int i = 1; i <= n; ++i) {
    if (mark[i] == 1) continue;
    comp.push_back(vector<int>());
    have.push_back(0);
    dfs_c(i, comp.back(), have.back());
    cnt += min(have.back(), 1);
    if (have.back()) id = have.size() - 1;
  }
  if (cnt > 1) {
    puts("-1");
    exit(0);
  }
  if (cnt == 0) {
    puts("0");
    exit(0);
  }
  vector<int> ans;
  dfs_go(comp[id][0], 0, ans);
  cout << ans.size() << "\n";
  for (int i = 0, sz = ans.size(); i < sz; ++i) {
    cout << ans[i] << (i == sz - 1 ? '\n' : ' ');
  }
  getchar();
  getchar();
  return 0;
}
