#include <bits/stdc++.h>
using namespace std;
const int inft = 1000000009;
const int MAXN = 100005;
int n, m, start;
bool need[MAXN];
bool vis[MAXN];
int curr[MAXN];
vector<int> V[MAXN];
vector<int> ANS;
void DFS(int a, int skad) {
  ANS.push_back(a);
  curr[a]++;
  for (typeof((V[a]).begin()) it = (V[a]).begin(); it != (V[a]).end(); ++it) {
    if (!vis[*it]) {
      vis[*it] = true;
      DFS(*it, a);
      ANS.push_back(a);
      curr[a]++;
    }
  }
  if (curr[a] % 2 != need[a]) {
    if (skad != -1) {
      curr[a]++;
      curr[skad]++;
      ANS.push_back(skad);
      ANS.push_back(a);
    } else {
      curr[a]--;
      ANS.pop_back();
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < (m); ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--;
    b--;
    V[a].push_back(b);
    V[b].push_back(a);
  }
  start = -1;
  for (int i = 0; i < (n); ++i) {
    int a;
    scanf("%d", &a);
    need[i] = a;
    if (a) start = i;
  }
  if (start == -1) {
    printf("0\n");
    return 0;
  }
  vis[start] = 1;
  DFS(start, -1);
  for (int i = 0; i < (n); ++i)
    if (need[i] != curr[i] % 2) {
      printf("-1\n");
      return 0;
    }
  printf("%d\n", ANS.size());
  for (typeof((ANS).begin()) it = (ANS).begin(); it != (ANS).end(); ++it)
    printf("%d ", *it + 1);
  puts("");
  return 0;
}
