#!/usr/bin/env python3 # %% import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines # %% N, M = map(int, readline().split()) m = map(int, read().split()) AB = zip(m, m) # %% G = [[] for _ in range(N)] for a, b in AB: if a > b: a, b = b, a G[b].append(a) # %% buy = [False] * N for n in range(N - 1, -1, -1): if buy[n]: continue for v in G[n]: buy[v] = True # %% while not buy[-1]: buy.pop() print(''.join('1' if bl else '0' for bl in buy[::-1]))