#include <bits/stdc++.h>
using namespace std;
const int nn = 110000;
int n, m, p[nn], v[nn];
vector<int> E[nn], an;
void add(int x) {
  an.push_back(x);
  p[x] ^= 1;
}
void dfs(int x) {
  v[x] = 1;
  add(x);
  for (int i = 0; i < (int)(((int)(E[x].size()))); ++i) {
    int j = E[x][i];
    if (!v[j]) {
      dfs(j), add(x);
      if (p[j]) add(j), add(x);
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= (int)(m); ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    E[x].push_back(y);
    E[y].push_back(x);
  }
  int s = -1;
  for (int i = 1; i <= (int)(n); ++i) {
    scanf("%d", &p[i]);
    if (p[i]) s = i;
  }
  if (s < 0) {
    puts("0");
    return 0;
  }
  dfs(s);
  if (p[s]) an.pop_back(), p[s] = 0;
  for (int i = 1; i <= (int)(n); ++i)
    if (p[i]) {
      puts("-1");
      return 0;
    }
  cout << ((int)(an.size())) << endl;
  for (int i = 0; i < (int)(((int)(an.size()))); ++i) printf("%d ", an[i]);
  return 0;
}
