#include <bits/stdc++.h>
const int MAX = 1e5 + 20;
using namespace std;
int n, m, x, y;
int vis[500001], a[500001];
vector<int> son[500001], Ans;
void insert(int x) {
  a[x] ^= 1;
  Ans.push_back(x);
}
void dfs(int u, int last) {
  vis[u] = 1;
  insert(u);
  for (auto v : son[u])
    if (!vis[v]) {
      dfs(v, u);
      insert(u);
    }
  if (a[u]) {
    if (last) {
      insert(last);
      insert(u);
    } else {
      Ans.pop_back();
      a[u] ^= 1;
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &x, &y);
    son[x].push_back(y);
    son[y].push_back(x);
  }
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= n; ++i)
    if (a[i]) {
      dfs(i, 0);
      break;
    }
  for (int i = 1; i <= n; i++)
    if (a[i]) {
      printf("-1\n");
      return 0;
    }
  printf("%d\n", (int)Ans.size());
  for (auto x : Ans) printf("%d ", x);
  return 0;
}
