#include <bits/stdc++.h>
using namespace std;
bool check[100005];
vector<int> edge[100005], ans;
int n;
int a[100005];
void dfs(int x, int p) {
  check[x] = true;
  ans.push_back(x);
  a[x] ^= 1;
  for (int i = 0; i < edge[x].size(); i++) {
    if (!check[edge[x][i]]) {
      dfs(edge[x][i], x);
      ans.push_back(x);
      a[x] ^= 1;
    }
  }
  if (a[x]) {
    if (p == 0)
      ans.pop_back();
    else {
      ans.push_back(p);
      a[p] ^= 1;
      ans.push_back(x);
    }
    a[x] ^= 1;
  }
}
int main() {
  int m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    edge[x].push_back(y);
    edge[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    if (a[i]) {
      dfs(i, 0);
      break;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i]) {
      printf("-1");
      return 0;
    }
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) printf("%d ", ans[i]);
  return 0;
}
