#include <bits/stdc++.h>
using namespace std;
int n, m, a, b, req[200001], parent[200001];
vector<int> e[200001], ans;
bool visited[200001], cnt[200001];
void dfs(int i) {
  cerr << i << endl;
  ans.push_back(i);
  visited[i] = 1;
  cnt[i] ^= 1;
  for (auto&& x : e[i])
    if (!visited[x]) {
      parent[x] = i;
      dfs(x);
      cnt[i] ^= 1;
      ans.push_back(i);
    }
  if (cnt[i] ^ req[i]) {
    if (parent[i]) ans.push_back(parent[i]), cnt[parent[i]] ^= 1;
    ans.push_back(i);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  while (m--) {
    scanf("%d%d", &a, &b);
    e[a].emplace_back(b);
    e[b].emplace_back(a);
  }
  for (int i = 1; i <= n; ++i) scanf("%d", req + i);
  auto start = find(req + 1, req + 1 + n, 1);
  if (start == req + 1 + n) return puts("0"), 0;
  dfs(start - req);
  for (int i = 1; i <= n; ++i)
    if (req[i] && !visited[i]) return puts("-1"), 0;
  if (ans.back() == ans[ans.size() - 2]) ans.pop_back(), ans.pop_back();
  printf("%d\n", ans.size());
  for (auto&& x : ans) printf("%d ", x);
}
