#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > adj;
int N, M;
int seen[(100005)];
bool parity[(100005)];
int num_comp;
vector<int> components[(100005)];
int path[4 * (100005)];
int len;
void dfs(int at) {
  components[num_comp].push_back(at);
  ;
  seen[at] = num_comp;
  for (int v : adj[at]) {
    if (!seen[v]) {
      dfs(v);
    }
  }
}
bool seen2[(100005)];
int considering_comp;
void dfs2(int at) {
  seen2[at] = true;
  for (int v : adj[at]) {
    if (!seen2[v] && seen[v] == considering_comp) {
      if (len == 0 || path[len - 1] != at) path[len++] = at;
      dfs2(v);
    }
  }
  if (len == 0 || path[len - 1] != at) path[len++] = at;
}
int last[(100005)];
int cur_parity[(100005)];
int ans[4 * (100005)];
int n_ans;
int main() {
  int u, v;
  scanf("%d %d", &N, &M);
  adj.resize(N);
  for (int i = 0; i < M; i++) {
    scanf("%d %d", &u, &v);
    u--, v--;
    adj[u].push_back(v);
    ;
    adj[v].push_back(u);
    ;
  }
  adj.resize(N + 1);
  int num_one = 0;
  for (int i = 0; i < N; i++) {
    scanf("%d", &u);
    if (u) {
      parity[i] = 1;
      num_one++;
    }
  }
  if (num_one == 0) {
    printf("0\n");
    return 0;
  }
  num_comp = 0;
  for (int i = 0; i < N; i++) {
    if (!seen[i]) {
      num_comp++;
      dfs(i);
    }
  }
  for (int i = 1; i <= num_comp; i++) {
    int cnt = 0;
    int start = -1;
    for (int first : components[i]) {
      if (parity[first]) {
        cnt++;
      }
      if (start == -1) start = first;
    }
    if (cnt == num_one) {
      considering_comp = i;
      dfs2(start);
      memset(last, -1, sizeof(last));
      for (int j = len - 1; j >= 0; j--) {
        if (last[path[j]] == -1) {
          last[path[j]] = j;
        }
      }
      for (int j = 0; j < len; j++) {
        if (last[path[j]] != j) {
          ans[n_ans++] = path[j] + 1;
          cur_parity[path[j]] ^= 1;
        } else {
          u = path[j];
          if (j + 1 == len) {
            if (cur_parity[u] != parity[u]) {
              ans[n_ans++] = u + 1;
            }
          } else {
            if (cur_parity[u] != parity[u]) {
              ans[n_ans++] = u + 1;
            } else {
              ans[n_ans++] = u + 1;
              ans[n_ans++] = path[j + 1] + 1;
              ans[n_ans++] = u + 1;
              cur_parity[path[j + 1]] ^= 1;
            }
          }
        }
      }
      printf("%d\n", n_ans);
      for (int j = 0; j < n_ans; j++) printf("%d ", ans[j]);
      return 0;
    }
  }
  printf("-1\n");
  return 0;
}
