#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, m, b[N], s, v[N];
vector<int> e[N];
vector<int> ans;
inline void mark(int x) {
  b[x] ^= 1;
  ans.push_back(x);
}
void dfs(int x) {
  v[x] = 1;
  mark(x);
  for (int i = 0; i < e[x].size(); ++i) {
    if (v[e[x][i]] == 0) {
      v[e[x][i]] = 1;
      dfs(e[x][i]);
      mark(x);
      if (b[e[x][i]]) {
        mark(e[x][i]);
        mark(x);
      }
    }
  }
}
bool check() {
  for (int i = 1; i <= n; ++i)
    if (b[i] && i != s) return 0;
  return 1;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    int t1, t2;
    scanf("%d%d", &t1, &t2);
    e[t1].push_back(t2);
    e[t2].push_back(t1);
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &b[i]);
    if (b[i]) s = i;
  }
  dfs(s);
  if (check() == 0) {
    puts("-1");
  } else {
    if (b[s]) {
      printf("%d\n", ans.size() - 1);
      for (int i = 0; i < ans.size() - 1; ++i) printf("%d ", ans[i]);
    } else {
      printf("%d\n", ans.size());
      for (int i = 0; i < ans.size(); ++i) printf("%d ", ans[i]);
    }
  }
  return 0;
}
