#include <bits/stdc++.h>
using namespace std;
vector<int> v[100005];
bool f[100005];
int p[400005];
bool check[100005];
int sta;
int sum;
void dfs(int num, int fa) {
  check[num] = 1;
  p[sum++] = num;
  f[num] = !f[num];
  for (int i = 0; i < v[num].size(); i++) {
    if (v[num][i] != fa && !check[v[num][i]]) {
      dfs(v[num][i], num);
      p[sum++] = num;
      f[num] = !f[num];
    }
  }
  if (f[num]) {
    if (fa) {
      p[sum++] = fa;
      p[sum++] = num;
      f[fa] = !f[fa];
      f[num] = !f[num];
    } else {
      if (sta)
        sta = 0;
      else
        sta = 1;
      f[num] = !f[num];
    }
  }
  return;
}
int main() {
  int n, m;
  int l, r;
  while (~scanf("%d%d", &n, &m)) {
    memset(check, 0, sizeof(check));
    for (int i = 1; i <= n; i++) v[i].clear();
    for (int i = 1; i <= m; i++) {
      scanf("%d%d", &l, &r);
      v[l].push_back(r);
      v[r].push_back(l);
    }
    for (int i = 1; i <= n; i++) scanf("%d", &f[i]);
    sum = 0;
    sta = 0;
    for (int i = 1; i <= n; i++) {
      if (f[i]) {
        dfs(i, 0);
        break;
      }
    }
    for (int i = 1; i <= n; i++) {
      if (f[i]) {
        printf("-1\n");
        goto A;
      }
    }
    printf("%d\n", sum - sta);
    for (int i = sta; i < sum; i++) {
      if (i != sta)
        printf(" %d", p[i]);
      else
        printf("%d", p[i]);
    }
  A:;
    printf("\n");
  }
  return 0;
}
