#include <bits/stdc++.h>
#pragma warning(disable : 4996)
inline void getint(int &k) {
  k = 0;
  bool sign = 0;
  char c;
  while (c = getchar(), c != '-' && (c < '0' || c > '9'))
    ;
  if (c == '-')
    sign = 1;
  else
    k = c - '0';
  while (c = getchar(), c >= '0' && c <= '9') k = k * 10 + c - '0';
  if (sign) k = -k;
}
inline void getll(long long &k) {
  k = 0;
  bool sign = 0;
  char c;
  while (c = getchar(), c != '-' && (c < '0' || c > '9'))
    ;
  if (c == '-')
    sign = 1;
  else
    k = c - '0';
  while (c = getchar(), c >= '0' && c <= '9') k = k * 10 + c - '0';
  if (sign) k = -k;
}
using namespace std;
using namespace std;
const int maxn = 100001;
vector<int> ans;
vector<int> point[maxn];
bool pos[maxn] = {0};
bool visit[maxn] = {0};
int n, m, b, c, cnt = 0;
void dfs(int x, int fa) {
  visit[x] = 1;
  ans.push_back(x);
  pos[x] ^= 1;
  if (point[x].size()) {
    for (int i = 0; i <= point[x].size() - 1; i++) {
      int y = point[x][i];
      if (!visit[y]) dfs(y, x), ans.push_back(x), pos[x] ^= 1;
    }
  }
  if (pos[x]) {
    if (fa)
      ans.push_back(fa), pos[fa] ^= 1, ans.push_back(x), pos[x] ^= 1;
    else
      ans.pop_back(), pos[x] ^= 1;
  }
}
int main() {
  ans.clear();
  getint(n);
  getint(m);
  for (int i = 1; i <= n; i++) point[i].clear();
  while (m--) {
    scanf("%d%d", &b, &c);
    point[b].push_back(c);
    point[c].push_back(b);
  }
  for (int i = 1; i <= n; i++) scanf("%d", &pos[i]), cnt += pos[i];
  if (!cnt)
    printf("0\n");
  else {
    for (int i = 1; i <= n; i++)
      if (pos[i]) {
        dfs(i, 0);
        break;
      }
    bool Ans = 1;
    for (int i = 1; i <= n; i++)
      if (pos[i]) Ans = 0;
    if (Ans) {
      printf("%d\n", ans.size());
      for (int i = 0; i <= ans.size() - 1; i++) printf("%d ", ans[i]);
    } else
      printf("-1\n");
  }
  return 0;
}
