#C4621. Odd Coin Collection

    ID: 48180 Type: Default 1000ms 256MiB

Odd Coin Collection

Odd Coin Collection

Alice is placed in a grid, where each cell contains a certain number of coins. Starting from the top-left corner, she collects the coins from every cell exactly once as she moves through the grid, and finally reaches the bottom-right corner. Your task is to determine whether the total number of coins collected is odd or even. If the total is odd, output Yes; otherwise, output No.

Note: The grid is provided in a structured format where the first line specifies the dimensions of the grid and the subsequent lines provide the coin values for each cell.

inputFormat

The input is given from stdin and has the following format:

  • The first line contains two integers N and M — the number of rows and columns in the grid respectively.
  • Each of the next N lines contains M space-separated integers representing the number of coins in each cell of that row.

outputFormat

The output should be printed to stdout and consists of a single line containing either Yes (if the total number of coins is odd) or No (if it is even).## sample

3 3
1 2 3
4 5 6
7 8 9
Yes