
import java.util.*;

public class Main {

    static class Step {
        int t;
        int x;
        int y;

        public Step(int t, int x, int y) {
            this.t = t;
            this.x = x;
            this.y = y;
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        List<Step> steps = new ArrayList<>();
        int N = scanner.nextInt();

        for (int i = 0; i < N; i++) {
            int t = scanner.nextInt();
            int x = scanner.nextInt();
            int y = scanner.nextInt();

            steps.add(new Step(t, x, y));
        }

        boolean can = true;
        int xStart = 0, yStart = 0, tStart = 0;
        for (int i = 0; i < steps.size(); i++) {
            int t = steps.get(i).t - tStart;
            int dist = Math.abs(steps.get(i).x - xStart) + Math.abs(steps.get(i).y - yStart);
            if (t < dist) {
                can = false;
            } else {
                can = t % 2 == dist % 2;
            }
            if (!can) {
                break;
            }
            tStart = steps.get(i).t;
            xStart = steps.get(i).x;
            yStart = steps.get(i).y;
        }


        if (can) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} import java.util.*; util.* java public class Main {

    static class Step {
        int t;
        int x;
        int y;

        public Step(int t, int x, int y) {
            this.t = t;
            this.x = x;
            this.y = y;
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        List<Step> steps = new ArrayList<>();
        int N = scanner.nextInt();

        for (int i = 0; i < N; i++) {
            int t = scanner.nextInt();
            int x = scanner.nextInt();
            int y = scanner.nextInt();

            steps.add(new Step(t, x, y));
        }

        boolean can = true;
        int xStart = 0, yStart = 0, tStart = 0;
        for (int i = 0; i < steps.size(); i++) {
            int t = steps.get(i).t - tStart;
            int dist = Math.abs(steps.get(i).x - xStart) + Math.abs(steps.get(i).y - yStart);
            if (t < dist) {
                can = false;
            } else {
                can = t % 2 == dist % 2;
            }
            if (!can) {
                break;
            }
            tStart = steps.get(i).t;
            xStart = steps.get(i).x;
            yStart = steps.get(i).y;
        }


        if (can) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        List<Step> steps = new ArrayList<>();
        int N = scanner.nextInt();

        for (int i = 0; i < N; i++) {
            int t = scanner.nextInt();
            int x = scanner.nextInt();
            int y = scanner.nextInt();

            steps.add(new Step(t, x, y));
        }

        boolean can = true;
        int xStart = 0, yStart = 0, tStart = 0;
        for (int i = 0; i < steps.size(); i++) {
            int t = steps.get(i).t - tStart;
            int dist = Math.abs(steps.get(i).x - xStart) + Math.abs(steps.get(i).y - yStart);
            if (t < dist) {
                can = false;
            } else {
                can = t % 2 == dist % 2;
            }
            if (!can) {
                break;
            }
            tStart = steps.get(i).t;
            xStart = steps.get(i).x;
            yStart = steps.get(i).y;
        }


        if (can) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    } main {
        Scanner scanner = new Scanner(System.in);

        List<Step> steps = new ArrayList<>();
        int N = scanner.nextInt();

        for (int i = 0; i < N; i++) {
            int t = scanner.nextInt();
            int x = scanner.nextInt();
            int y = scanner.nextInt();

            steps.add(new Step(t, x, y));
        }

        boolean can = true;
        int xStart = 0, yStart = 0, tStart = 0;
        for (int i = 0; i < steps.size(); i++) {
            int t = steps.get(i).t - tStart;
            int dist = Math.abs(steps.get(i).x - xStart) + Math.abs(steps.get(i).y - yStart);
            if (t < dist) {
                can = false;
            } else {
                can = t % 2 == dist % 2;
            }
            if (!can) {
                break;
            }
            tStart = steps.get(i).t;
            xStart = steps.get(i).x;
            yStart = steps.get(i).y;
        }


        if (can) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) List<Step> steps = new ArrayList<>(); steps new ArrayList<>() int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner for (int i = 0; i < N; i++) {
            int t = scanner.nextInt();
            int x = scanner.nextInt();
            int y = scanner.nextInt();

            steps.add(new Step(t, x, y));
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            int t = scanner.nextInt();
            int x = scanner.nextInt();
            int y = scanner.nextInt();

            steps.add(new Step(t, x, y));
        } {
            int t = scanner.nextInt();
            int x = scanner.nextInt();
            int y = scanner.nextInt();

            steps.add(new Step(t, x, y));
        } int t = scanner.nextInt(); t scanner.nextInt() scanner.nextInt scanner int x = scanner.nextInt(); x scanner.nextInt() scanner.nextInt scanner int y = scanner.nextInt(); y scanner.nextInt() scanner.nextInt scanner steps.add(new Step(t, x, y)) steps.add steps new Step(t, x, y) boolean can = true; can true int xStart = 0 xStart 0 yStart = 0 yStart 0 tStart = 0; tStart 0 for (int i = 0; i < steps.size(); i++) {
            int t = steps.get(i).t - tStart;
            int dist = Math.abs(steps.get(i).x - xStart) + Math.abs(steps.get(i).y - yStart);
            if (t < dist) {
                can = false;
            } else {
                can = t % 2 == dist % 2;
            }
            if (!can) {
                break;
            }
            tStart = steps.get(i).t;
            xStart = steps.get(i).x;
            yStart = steps.get(i).y;
        } int i = 0; int i = 0; i 0 i < steps.size() i steps.size() steps.size steps i++ i++ i {
            int t = steps.get(i).t - tStart;
            int dist = Math.abs(steps.get(i).x - xStart) + Math.abs(steps.get(i).y - yStart);
            if (t < dist) {
                can = false;
            } else {
                can = t % 2 == dist % 2;
            }
            if (!can) {
                break;
            }
            tStart = steps.get(i).t;
            xStart = steps.get(i).x;
            yStart = steps.get(i).y;
        } {
            int t = steps.get(i).t - tStart;
            int dist = Math.abs(steps.get(i).x - xStart) + Math.abs(steps.get(i).y - yStart);
            if (t < dist) {
                can = false;
            } else {
                can = t % 2 == dist % 2;
            }
            if (!can) {
                break;
            }
            tStart = steps.get(i).t;
            xStart = steps.get(i).x;
            yStart = steps.get(i).y;
        } int t = steps.get(i).t - tStart; t steps.get(i).t - tStart steps.get(i).t steps.get(i) steps.get steps i steps.get(i).t tStart int dist = Math.abs(steps.get(i).x - xStart) + Math.abs(steps.get(i).y - yStart); dist Math.abs(steps.get(i).x - xStart) + Math.abs(steps.get(i).y - yStart) Math.abs(steps.get(i).x - xStart) Math.abs Math steps.get(i).x - xStart steps.get(i).x steps.get(i) steps.get steps i steps.get(i).x xStart Math.abs(steps.get(i).y - yStart) Math.abs Math steps.get(i).y - yStart steps.get(i).y steps.get(i) steps.get steps i steps.get(i).y yStart if (t < dist) {
                can = false;
            } else {
                can = t % 2 == dist % 2;
            } t < dist t dist {
                can = false;
            } can = false can false {
                can = t % 2 == dist % 2;
            } can = t % 2 == dist % 2 can t % 2 == dist % 2 t % 2 t 2 dist % 2 dist 2 if (!can) {
                break;
            } !can can {
                break;
            } break; tStart = steps.get(i).t tStart steps.get(i).t steps.get(i) steps.get steps i steps.get(i).t xStart = steps.get(i).x xStart steps.get(i).x steps.get(i) steps.get steps i steps.get(i).x yStart = steps.get(i).y yStart steps.get(i).y steps.get(i) steps.get steps i steps.get(i).y if (can) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        } can {
            System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" {
            System.out.println("No");
        } System.out.println("No") System.out.println System.out System System.out "No" String[] args args static class Step {
        int t;
        int x;
        int y;

        public Step(int t, int x, int y) {
            this.t = t;
            this.x = x;
            this.y = y;
        }
    } Step int t; t int x; x int y; y public Step(int t, int x, int y) {
            this.t = t;
            this.x = x;
            this.y = y;
        } Step {
            this.t = t;
            this.x = x;
            this.y = y;
        } this.t = t this.t this this.t t this.x = x this.x this this.x x this.y = y this.y this this.y y int t t int x x int y y public class Main {

    static class Step {
        int t;
        int x;
        int y;

        public Step(int t, int x, int y) {
            this.t = t;
            this.x = x;
            this.y = y;
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        List<Step> steps = new ArrayList<>();
        int N = scanner.nextInt();

        for (int i = 0; i < N; i++) {
            int t = scanner.nextInt();
            int x = scanner.nextInt();
            int y = scanner.nextInt();

            steps.add(new Step(t, x, y));
        }

        boolean can = true;
        int xStart = 0, yStart = 0, tStart = 0;
        for (int i = 0; i < steps.size(); i++) {
            int t = steps.get(i).t - tStart;
            int dist = Math.abs(steps.get(i).x - xStart) + Math.abs(steps.get(i).y - yStart);
            if (t < dist) {
                can = false;
            } else {
                can = t % 2 == dist % 2;
            }
            if (!can) {
                break;
            }
            tStart = steps.get(i).t;
            xStart = steps.get(i).x;
            yStart = steps.get(i).y;
        }


        if (can) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} public class Main {

    static class Step {
        int t;
        int x;
        int y;

        public Step(int t, int x, int y) {
            this.t = t;
            this.x = x;
            this.y = y;
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        List<Step> steps = new ArrayList<>();
        int N = scanner.nextInt();

        for (int i = 0; i < N; i++) {
            int t = scanner.nextInt();
            int x = scanner.nextInt();
            int y = scanner.nextInt();

            steps.add(new Step(t, x, y));
        }

        boolean can = true;
        int xStart = 0, yStart = 0, tStart = 0;
        for (int i = 0; i < steps.size(); i++) {
            int t = steps.get(i).t - tStart;
            int dist = Math.abs(steps.get(i).x - xStart) + Math.abs(steps.get(i).y - yStart);
            if (t < dist) {
                can = false;
            } else {
                can = t % 2 == dist % 2;
            }
            if (!can) {
                break;
            }
            tStart = steps.get(i).t;
            xStart = steps.get(i).x;
            yStart = steps.get(i).y;
        }


        if (can) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} Main

import java.util.*;

public class Main {

    static class Step {
        int t;
        int x;
        int y;

        public Step(int t, int x, int y) {
            this.t = t;
            this.x = x;
            this.y = y;
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        List<Step> steps = new ArrayList<>();
        int N = scanner.nextInt();

        for (int i = 0; i < N; i++) {
            int t = scanner.nextInt();
            int x = scanner.nextInt();
            int y = scanner.nextInt();

            steps.add(new Step(t, x, y));
        }

        boolean can = true;
        int xStart = 0, yStart = 0, tStart = 0;
        for (int i = 0; i < steps.size(); i++) {
            int t = steps.get(i).t - tStart;
            int dist = Math.abs(steps.get(i).x - xStart) + Math.abs(steps.get(i).y - yStart);
            if (t < dist) {
                can = false;
            } else {
                can = t % 2 == dist % 2;
            }
            if (!can) {
                break;
            }
            tStart = steps.get(i).t;
            xStart = steps.get(i).x;
            yStart = steps.get(i).y;
        }


        if (can) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}
