#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int n, m;
int a[100000];
vector<int> e[100000];
bool chk[100000];
int ac;
int ans[400000];
int lx = -1;
void solve(int x) {
  chk[x] = true;
  ans[ac++] = x;
  a[x] ^= 1;
  for (int i = 0; i < e[x].size(); i++) {
    int y = e[x][i];
    if (!chk[y]) {
      solve(y);
      lx = y;
      ans[ac++] = x;
      a[x] ^= 1;
      if (a[y]) {
        ans[ac++] = y;
        a[y] ^= 1;
        ans[ac++] = x;
        a[x] ^= 1;
      }
    }
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    x--;
    y--;
    e[x].push_back(y);
    e[y].push_back(x);
  }
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int c = 0, x = -1;
  for (int i = 0; i < n; i++)
    if (a[i]) c++, x = i;
  if (c == 0)
    printf("0\n");
  else if (c == 1) {
    printf("1\n");
    printf("%d\n", x + 1);
  } else {
    solve(x);
    if (lx != -1) {
      if (!a[x] && !a[lx])
        ;
      else if (!a[x] && a[lx]) {
        ans[ac++] = lx;
        a[lx] ^= 1;
      } else if (a[x] && !a[lx]) {
        ans[ac++] = lx;
        a[lx] ^= 1;
        ans[ac++] = x;
        a[x] ^= 1;
        ans[ac++] = lx;
        a[lx] ^= 1;
      } else if (a[x] && a[lx]) {
        ans[ac++] = lx;
        a[lx] ^= 1;
        ans[ac++] = x;
        a[x] ^= 1;
      }
    }
    bool f = true;
    for (int i = 0; i < n; i++)
      if (a[i]) {
        f = false;
        break;
      }
    if (f) {
      printf("%d\n", ac);
      for (int i = 0; i < ac; i++) printf("%d ", ans[i] + 1);
      printf("\n");
    } else
      printf("-1\n");
  }
  return 0;
}
