#include <bits/stdc++.h>
using namespace std;
int n, m, u, v;
int tot, there[100005 << 1], nx[100005 << 1], head[100005];
inline void addedge(int x, int y) {
  ++tot;
  there[tot] = y;
  nx[tot] = head[x];
  head[x] = tot;
}
int o[100005];
vector<int> st;
bool mark[100005];
void dfs(int x) {
  mark[x] = 1;
  st.push_back(x);
  o[x] ^= 1;
  for (int i = head[x]; i; i = nx[i])
    if (!mark[there[i]]) {
      dfs(there[i]);
      st.push_back(x);
      o[x] ^= 1;
      if (o[there[i]]) {
        st.push_back(there[i]);
        st.push_back(x);
        o[there[i]] ^= 1;
        o[x] ^= 1;
      }
    }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &u, &v);
    addedge(u, v);
    addedge(v, u);
  }
  for (int i = 1; i <= n; ++i) scanf("%d", &o[i]);
  for (int i = 1; i <= n; ++i)
    if (o[i]) {
      dfs(i);
      if (o[i]) {
        st.erase(st.begin());
        o[i] ^= 1;
      }
      break;
    }
  for (int i = 1; i <= n; ++i)
    if (o[i]) {
      printf("-1\n");
      return 0;
    }
  printf("%d\n", st.size());
  for (int i = 0; i < st.size(); ++i) printf("%d ", st[i]);
  return 0;
}
