#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "[";
  for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++i) {
    if (i != v.begin()) os << ", ";
    os << *i;
  }
  os << "]";
  return os;
}
vector<vector<int> > G;
vector<int> P, R;
vector<bool> V;
void add(int x) {
  R.push_back(x);
  P[x] = 1 - P[x];
}
void DFS(int x) {
  V[x] = true;
  add(x);
  for (__typeof((G[x]).begin()) i = (G[x]).begin(); i != (G[x]).end(); ++i)
    if (!V[*i]) {
      DFS(*i);
      add(x);
      if (P[*i]) {
        add(*i);
        add(x);
      }
    }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  G.resize(n);
  for (int i = 0; i < (int)(m); ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    --a, --b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  P.resize(n);
  for (int i = 0; i < (int)(n); ++i) scanf("%d", &P[i]);
  V.resize(n, false);
  for (int i = 0; i < (int)(n); ++i)
    if (P[i]) {
      DFS(i);
      if (P[i]) {
        assert(((int)((R).size())) >= 1 && R.back() == i);
        R.pop_back();
        P[i] = 0;
      }
      break;
    }
  for (int i = 0; i < (int)(n); ++i)
    if (P[i]) {
      printf("-1\n");
      return 0;
    }
  printf("%d\n", ((int)((R).size())));
  for (int i = 0; i < (int)(((int)((R).size()))); ++i)
    printf(" %d" + (i == 0), R[i] + 1);
  printf("\n");
}
