import java.io.*;
import java.util.*;

public class Bjarki {
    static boolean[] exact = new boolean[360];
    static boolean[] half = new boolean[360];

    static void visit(int a, int b) {
        if (((a-b)%360+360)%360 == 180) {
            System.out.println("yes");
            System.exit(0);
        }

        if (a < 0) a += 360;
        if (b < 0) b += 360;

        if (((b-a)%360+360)%360 > ((a-b)%360+360)%360) {
            int c = a;
            a = b;
            b = c;
        }

        while (true) {
            exact[a] = true;
            if (a == b) break;
            half[a] = true;
            a++;
            if (a == 360) a = 0;
        }
    }

    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextInt();
        int first = in.nextInt();
        int last = first;
        for (int i = 0; i < n-1; i++) {
            in.nextInt();
            int cur = in.nextInt();
            visit(last, cur);
            last = cur;
        }
        visit(last, first);
        for (int i = 0; i < 360; i++) {
            if (!exact[i]) {
                System.out.printf("no %d.0", i >= 180 ? i - 360 : i);
                return;
            }
            if (!half[i]) {
                if (i >= 180) {
                    System.out.printf("no -%d.5", -(i - 360 + 1));
                } else {
                    System.out.printf("no %d.5", i);
                }
                return;
            }
        }
        System.out.println("yes");
    }
}
