#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long double pi = acos(-1.0);
const string debug_line = "yolo";
const long double PI = acos((long double)-1.0);
const long double eps = 1e-6;
unsigned long long getRand() {
  return ((unsigned long long)rand() << 40) +
         ((unsigned long long)rand() << 20) + ((unsigned long long)rand());
}
vector<int> paths;
bool visited[100010];
vector<int> Adj[100010];
int cntGroups = 0;
bool isOdd[100010];
void DFS(int u, int p) {
  visited[u] = true;
  paths.push_back(u);
  isOdd[u] ^= 1;
  for (auto &(t1) : (Adj[u])) {
    if (!visited[t1]) {
      DFS(t1, u);
      paths.push_back(u);
      isOdd[u] ^= 1;
    }
  }
  if (isOdd[u] && p != -1) {
    paths.push_back(p);
    isOdd[p] ^= 1;
    paths.push_back(u);
    isOdd[u] ^= 1;
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int(i) = (0); (i) < (m); ++(i)) {
    int a1, b1;
    scanf("%d%d", &a1, &b1);
    Adj[a1].push_back(b1);
    Adj[b1].push_back(a1);
  }
  int start1 = -1;
  for (int(i) = (1); (i) < (n + 1); ++(i)) {
    int temp;
    scanf("%d", &temp);
    isOdd[i] = temp;
    if (isOdd[i]) {
      start1 = i;
    }
  }
  if (start1 == -1) {
    puts("0");
    return 0;
  } else {
    DFS(start1, -1);
    if (isOdd[start1]) {
      paths.pop_back();
      isOdd[start1] ^= 1;
    }
    for (int(i) = (1); (i) < (n + 1); ++(i)) {
      if (isOdd[i]) {
        puts("-1");
        return 0;
      }
    }
    printf("%d\n", (int)paths.size());
    for (auto &(t1) : (paths)) {
      printf("%d\n", t1);
    }
    printf("\n");
  }
  return 0;
}
