import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd n,m = map(int,input().split()) graph = [[] for i in range(n+1)] e = [] for i in range(m): a,b = map(int,input().split()) graph[a].append(b) graph[b].append(a) e.append([a-1, b-1]) c = list(map(int,input().split())) ini = 0 for i in range(n): if c[i]: ini |= (1<> i) & 1: now ^= 1<