#include <bits/stdc++.h>
using namespace std;
int n, m, ans[400005], top, rt;
bool vis[100005], a[100005];
vector<int> v[100005];
void dfs(int x, int fa) {
  a[x] ^= 1;
  ans[++top] = x;
  vis[x] = 1;
  for (int i = 0; i < v[x].size(); i++) {
    int h = v[x][i];
    if (!vis[h]) {
      dfs(h, x);
      a[x] ^= 1;
      ans[++top] = x;
    }
  }
  if (a[x]) {
    if (!fa)
      top--;
    else
      a[fa] ^= 1, a[x] = 0, ans[++top] = fa, ans[++top] = x;
  }
}
signed main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i]) rt = i;
  }
  if (rt) {
    dfs(rt, 0);
    for (int i = 1; i <= n; i++)
      if (!vis[i] && a[i]) {
        puts("-1");
        return 0;
      }
  }
  printf("%d\n", top);
  for (int i = 1; i <= top; i++) printf("%d ", ans[i]);
}
