jiahuimbzuai/CoQuIR huggingface dataset:
//  [javascript]
var obj = init();
Main();
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function next(){return obj.next();}
function hasNext(){return obj.hasNext();}
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");}
function init(){
  var inputFile = myin();
  var returnObj = {
    "list" : inputFile, "index" : 0, "max" : inputFile.length,
    "hasNext" : function(){return (this.index < this.max);},
    "next" : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  	var one = nextIntArray();
	var H = one[0];
	var W = one[1];
	var list = new Array(H);
	var count = new Array(H);
	var access = new Array(H);
	for(var i = 0; i < H; i++){
		list[i] = nextCharArray();
		count[i] = new Array(W).fill(0);
		access[i] = new Array(W).fill(false);
	}
	var queue = [[0,0]];
	access[0][0] = true;
	count[0][0] = 1;
	var mod = 1000000007;
	var dy = [1,0];
	var dx = [0,1];
	while(queue.length > 0){
		var tmp = queue.shift();
		for(var i = 0; i < 2; i++){
			var nextY = tmp[0] + dy[i];
			var nextX = tmp[1] + dx[i];
			if(nextY < H && nextY >= 0 && nextX < W && nextX >= 0){
				if(list[nextY][nextX] == "." && !access[nextY][nextX]){
					var add = count[tmp[0]][tmp[1]];
					if(i == 0 && nextX > 0){
						add += count[nextY][nextX - 1];
					}else if(i == 1 && nextY > 0){
						add += count[nextY - 1][nextX];
					}
					count[nextY][nextX] = (add % mod);
					access[nextY][nextX] = true;
					queue.push([nextY, nextX]);
				}
			}
		}
	}
	myout(count[H - 1][W - 1]);
}
//  [javascript]
'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function getArray(str) {
    return str.split(' ').map(x => Number(x));
}

function getInt(str) {
    return Number(str);
}

function getStrArray(str) {
    return str.split(' ').map(x => x);
}

function create2DArray(row, col, filler = 0) {
    return Array(row)
        .fill(filler)
        .map(() => Array(col).fill(filler));
}
// ---------------------------------------



function main() {
    let [r, c] = getArray(readline());
    let arr = [];
    const mod = 1e9+7;

    for (let i = 0; i < r; i++) {
        arr.push(readline().split('').map(x => x));
    }

    let dp = create2DArray(r, c, 0);

    dp[0][0] = 1;
    for (let i = 1; i < r; i++) {
        if(arr[i][0] === '#') {
            dp[i][0] = 0;
        } else {
            dp[i][0] = dp[i - 1][0];
        }
    }

    for (let j = 1; j < c; j++) {
        if (arr[0][j] === '#') {
            dp[0][j] = 0;
        } else {
            dp[0][j] = dp[0][j-1];
        }
    }
    
    for (let i = 1; i < r; i++) {
        for (let j = 1; j < c; j++) {
            if(arr[i][j] === '#') {
                dp[i][j] = 0;
            } else {
                dp[i][j] = (dp[i-1][j] + dp[i][j-1])%mod;
            }
        }
    }
    console.log(dp[r-1][c-1]);
}
//  [javascript]

function Main(input) {
	input = input.trim().split("\n").map(function(x) { return x.split(" ")});    
	let C = 1e9 + 7;
	let H = parseInt(input[0][0], 10);
	let W = parseInt(input[0][1], 10);
	let DP = [];
	for (let i = 0; i < H; i++){
		DP.push(Array.from({length: W}, () => 0));
	}
	DP[0][0] = 1;
	for (let i = 1; i < H + W - 1; i ++){
		for (let j = 0; j <= Math.min(i, H - 1); j++){
			// console.log(i, j);
			if (input[j + 1][0][i - j] === '#' || i - j >= W) continue;
			if (j > 0 && i - j > 0) {
				DP[j][i - j] = (DP[j - 1][i - j] + DP[j][i - j - 1]) % C;
			} else if (j > 0){
				DP[j][i - j] = DP[j - 1][i - j];
			} else {
				DP[j][i - j] = DP[j][i - j - 1];
			}
			// console.log(DP);
		}
	}
	// console.log(DP);
	console.log(DP.pop().pop());
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

func readLine(r *bufio.Reader) []byte {
	buf := make([]byte, 0, 1024)
	for {
		l, p, e := r.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return buf
}

const mod = 1000000007

func main() {
	r := bufio.NewReaderSize(os.Stdin, 4096)

	var H, W int
	fmt.Scan(&H, &W)

	m := make([][]byte, H)
	for i := 0; i < H; i++ {
		m[i] = readLine(r)
	}

	var dp [1001][1001]int
	dp[0][1] = 1
	for y := 1; y <= H; y++ {
		for x := 1; x <= W; x++ {
			if m[y-1][x-1] == '.' {
				dp[y][x] = (dp[y-1][x] + dp[y][x-1]) % mod
			}
		}
	}

	out(dp[H][W])
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

const Mod = 1000000007

func main() {
	var h, w int
	fmt.Scan(&h, &w)
	r := NewReader(os.Stdin, 1024*4)

	grid := make([][]byte, h)
	for i := 0; i < h; i++ {
		grid[i] = r.Line()
	}

	var dp [1001][1001]int
	dp[0][0] = 1

	for i := 0; i < h; i++ {
		for j := 0; j < w; j++ {
			if grid[i][j] != '.' {
				continue
			}
			if i == 0 && j == 0 {
				dp[i][j] = 1
				continue
			}
			if i == 0 {
				dp[i][j] = dp[i][j-1]
				continue
			}
			if j == 0 {
				dp[i][j] = dp[i-1][j]
				continue
			}

			dp[i][j] = (dp[i-1][j] + dp[i][j-1]) % Mod
		}
	}

	fmt.Println(dp[h-1][w-1])
}

// generated by https://github.com/murosan/gollect

type Reader struct{ *bufio.Reader }

func NewReader(r io.Reader, size int) *Reader {
	return &Reader{Reader: bufio.NewReaderSize(r, size)}
}

func (r *Reader) Line() []byte { b, _ := r.ReadBytes('\n'); return b }
//  [go]
package main

import (
	"fmt"
	"io"
	"os"
)

const Mod = 1000000007

func main() {
	r := NewScannerSize(os.Stdin, 1024*8)
	h, w := r.Int(), r.Int()

	grid := make([]string, h)
	for i := 0; i < h; i++ {
		grid[i] = r.Text()
	}

	var dp [1001][1001]int
	dp[0][0] = 1

	for i := 0; i < h; i++ {
		for j := 0; j < w; j++ {
			if grid[i][j] != '.' {
				continue
			}
			if i == 0 && j == 0 {
				dp[i][j] = 1
				continue
			}
			if i == 0 {
				dp[i][j] = dp[i][j-1]
				continue
			}
			if j == 0 {
				dp[i][j] = dp[i-1][j]
				continue
			}

			dp[i][j] = (dp[i-1][j] + dp[i][j-1]) % Mod
		}
	}

	fmt.Println(dp[h-1][w-1])
}

// generated by https://github.com/murosan/gollect

type Scanner struct {
	r     io.Reader
	buf   []byte
	delim byte
	size, eof,
	start, end int
}

func NewScannerSize(r io.Reader, size int) *Scanner {
	return &Scanner{
		r:     r,
		buf:   make([]byte, size),
		delim: ' ',
		size:  size, start: size, end: size,
	}
}

func (s *Scanner) Text() string { return string(s.bytes()) }

func (s *Scanner) Int() int { return ParseInt(s.bytes()) }

func (s *Scanner) bytes() []byte { b, _ := s.next(); return b }
func (s *Scanner) next() (b []byte, size int) {
	for n := 0; ; {
		for i := s.end; i < s.size; i++ {
			if s.buf[i] == s.delim || s.buf[i] == '\n' || i == s.eof {
				b, size = s.buf[s.start:i], i-s.start
				s.start, s.end = i+1, i+1
				return
			}
		}
		s.end = s.size
		if n++; n == 2 {
			panic("lack of buffer size")
		}
		s.read()
	}
}
func (s *Scanner) read() {
	copy(s.buf, s.buf[s.start:s.end])
	s.end -= s.start
	s.start = 0
	n, _ := s.r.Read(s.buf[s.end:])
	s.eof = s.end + n
}

func ParseInt(b []byte) (n int) {
	var i int
	if b[0] == '-' {
		i++
	}
	for ; i < len(b); i++ {
		n *= 10
		n += int(b[i] - '0')
	}
	if b[0] == '-' {
		return -n
	}
	return
}
//  [go]
package main

import (
	"fmt"
	"math"
)

// MOD ...
var MOD int64 = int64(math.Pow(float64(10), float64(9)) + 7)

func main() {
	var h, w int
	fmt.Scanf("%d%d", &h, &w)
	grid := make([][]rune, h)
	for i := 0; i < h; i++ {
		grid[i] = make([]rune, w)
		var line string
		fmt.Scanf("%s", &line)
		for j := 0; j < w; j++ {
			grid[i][j] = rune(line[j])
		}
	}
	ans := numberOfPath(h, w, grid)
	fmt.Println(ans)
}

func numberOfPath(h int, w int, grid [][]rune) int {
	dp := createTable(h-1, w-1)
	for i := 0; i < w; i++ {
		if grid[0][i] == '#' {
			break
		}
		dp[0][i] = 1
	}
	for i := 0; i < h; i++ {
		if grid[i][0] == '#' {
			break
		}
		dp[i][0] = 1
	}

	for i := 1; i < h; i++ {
		for j := 1; j < w; j++ {
			if grid[i][j] == '.' {
				dp[i][j] = int(int64(dp[i-1][j]+dp[i][j-1]) % MOD)
			}
		}
	}
	return dp[h-1][w-1]
}

func createTable(n int, m int) [][]int {
	dp := make([][]int, n+1)
	for i := range dp {
		dp[i] = make([]int, m+1)
	}
	dp[0][0] = 0
	return dp
}
//  [go]
package main

import "fmt"
var H, W int
var A []string
var dp [][]int
const MOD = int(1e9)+7
func max(a, b int) int {
	if a > b { return a }
	return b
}

func min(a, b int) int {
	if a < b { return a }
	return b
}

func abs(a int) int {
	if a < 0 { return -a }
	return a
}

func main() {
	_,e := fmt.Scanf("%d%d", &H, &W)
	if e != nil { return }
	A = make([]string, H)
	for i:=0; i<H; i++ {
		_,e = fmt.Scanf("%s", &A[i])
	}
	dp := make([][]int, H)
	for i := range dp {
		dp[i] = make([]int, W)
	}
	dp[0][0] = 1
	for i:=1;i<W;i++ {
		if A[0][i] == '.' {
			dp[0][i] = dp[0][i-1]
		} else { break }
	}
	for i:=1;i<H;i++ {
		if A[i][0] == '.' {
			dp[i][0] = dp[i-1][0]
		} else { break }
	}

	for i:=1; i<H; i++ {
		for j:=1; j<W; j++ {
			if A[i][j] == '.' {
				dp[i][j] = (dp[i-1][j] + dp[i][j-1])%MOD
			} else {
				dp[i][j] = 0
			}
		}
	}
	fmt.Println(dp[H-1][W-1]%MOD)
}
//  [go]
package main

import "fmt"

const div = 1000000000 + 7

func main() {
	var H, W int
	fmt.Scan(&H, &W)
	m := make([][]bool, H+1)
	dp := make([][]int, H+1)
	for i := 0; i <= H; i++ {
		m[i] = make([]bool, W+1)
		dp[i] = make([]int, W+1)
	}
	var line string
	for y := 1; y <= H; y++ {
		fmt.Scan(&line)
		for i, r := range line {
			x := i + 1
			if r == '#' {
				m[y][x] = true
			}
		}
	}
	dp[1][1] = 1
	for y := 1; y <= H; y++ {
		for x := 1; x <= W; x++ {
			if m[y][x] {
				dp[y][x] = 0
			} else {
				dp[y][x] += dp[y-1][x] + dp[y][x-1]
				dp[y][x] %= div
			}
		}
	}
	fmt.Println(dp[H][W])
}
//  [ruby]
gets;a,*d=1;$<.map{|s|d=s.bytes.map{a=_1[2].*a.+d.shift||0}};p d[-2].%10**9+7
//  [ruby]
n,m=gets.split.map &:to_i;
d=[0]*m;
d[0]=1;
$<.map{|s|
	a=0;
	d=s.chop.chars.zip(d).map{|c,d|a=c==?. ? (d+a)%(10**9+7) : 0}
}
p d[-1]
//  [ruby]
MOD = 10 ** 9 + 7
h,w = gets.split.map(&:to_i)
dp = Array.new(h+1){[0]*(w+1)}
(h+1).times do |i|
  dp[i][0] = 0
end
dp[0][1] = 1

1.upto(h) do |i|
  l = gets.chomp
  1.upto(w) do |j|
    s = l[j-1]
    dp[i][j] = s == "." ? (dp[i][j-1] + dp[i-1][j]) % MOD : 0
  end
end
p dp[h][w] % MOD
//  [ruby]
h,w=gets.split.map &:to_i
a=[[-1]*(w+1)]
h.times{a<<[-1]+gets.chomp.chars.map{|c|c=='#'?-1:0}}
a[1][1]=1
(1..h).each{|i|(1..w).each{|j|a[i][j]=[a[i][j-1],0].max+[a[i-1][j],0].max if (i>1||j>1)&&a[i][j]>=0}}
p a[h][w]%(10**9+7)
//  [ruby]
H,W =gets.split.map &:to_i
grid = Array.new(H).map{Array.new(W,"")}
for i in 0...H
  grid[i]=gets.strip.split("").map{|i|i.codepoints[0]}
end
E=".".codepoints[0]
U="#".codepoints[0]
dp = Array.new(H).map{Array.new(W,0)}
dp[0][0]=1
for i in 1...W
  dp[0][i]=grid[0][i]==U ? 0 :  dp[0][i-1]
end
for i in 1...H
  dp[i][0]=grid[i][0]==U ? 0 :  dp[i-1][0]
end
for i in 1...W
  for j in 1...H
    if grid[j][i]==E
      dp[j][i]=dp[j-1][i]+dp[j][i-1]
    else
      dp[j][i]=0
    end
  end
end
puts dp[H-1][W-1] %(1000000007)
//  [rust]
static MOD: usize = 1000000007;

fn solve(aa: Vec<String>) -> usize {
    let h = aa.len();
    let w = aa[0].len();

    let mut dp = vec![0; w];
    dp[w - 1] = 1;

    for y in (0..h).rev() {
        let cs = aa[y].chars().collect::<Vec<_>>();

        if cs[w - 1] == '#' {
            dp[w - 1] = 0;
        }

        for x in (0..w - 1).rev() {
            if cs[x] == '#' {
                dp[x] = 0;
                continue;
            }

            dp[x] += dp[x + 1];
            dp[x] %= MOD;
        }
    }

    dp[0]
}

#[test]

fn solve_test() {
    assert_eq!(solve(vec!["..".to_owned(), "..".to_owned()]), 2);
    assert_eq!(solve(vec![".#".to_owned(), "#.".to_owned()]), 0);
    assert_eq!(
        solve(vec![
            "..#..".to_owned(),
            ".....".to_owned(),
            "#...#".to_owned(),
            ".....".to_owned(),
            "..#..".to_owned()
        ]),
        24
    );
}

#[allow(unused_macros)]
macro_rules! parse_line {
    ( $t:ty ) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            iter.next().unwrap().parse::<$t>().unwrap()
        }
    );

    ( $( $t:ty), +) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            ( $(iter.next().unwrap().parse::<$t>().unwrap()),* )
        }
    );
}

#[allow(unused_macros)]
macro_rules! read_line {
    () => {{
        let mut line = String::new();
        ::std::io::stdin().read_line(&mut line).unwrap();
        line.pop();
        line
    }};
}

#[allow(unused_macros)]
macro_rules! parse_vec {
    ( $t:ty ) => {{
        let mut line = String::new();
        ::std::io::stdin().read_line(&mut line).unwrap();
        let iter = line.split_whitespace();
        iter.map(|v| v.parse::<$t>().unwrap()).collect::<Vec<_>>()
    }};
}

fn main() {
    let (h, _w) = parse_line!(usize, usize);

    let aa = (0..h).map(|_| read_line!()).collect::<Vec<_>>();

    println!("{}", solve(aa));
}
//  [rust]

use std::collections::*;
// use std::io::prelude;
use std::io;
use std::io::Read;
use std::cmp::*;

fn main(){
    let t_cases = 1;
    for _ in 0..t_cases{
        solve();
    }
}

fn solve(){

    let MOD = 10i32.pow(9)+7;
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    let a = buf
                .trim()
                .split_whitespace()
                .map(|x| x.parse::<usize>().unwrap())
                .collect::<Vec<usize>>();
    let (m,n) = (a[0],a[1]);

    let mut g = vec![];
    for i in 0..m{
        let mut buf = String::new();
        io::stdin().read_line(&mut buf).unwrap();
        buf = buf.trim().to_owned();
        g.push(buf.as_bytes().to_owned());
    }
    let mut dp = vec![vec![0i32;n+1];m+1];
    dp[0][1] = 1;
    for i in 1..(m+1){
        for j in 1..(n+1){
            if g[i-1][j-1]=='#' as u8{continue;}
            dp[i][j] = (dp[i-1][j]+dp[i][j-1])%MOD;
        }
    }
    println!("{}",dp[m][n]);
}
//  [rust]
use std::collections::VecDeque;

#[allow(unused_macros)]
macro_rules! scan {
    () => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().to_string()
        }
    };
    (;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().split_whitespace().map(|s| s.to_string()).collect::<Vec<String>>()
        }
    };
    (;;$n:expr) => {
        {
            (0..$n).map(|_| scan!()).collect::<Vec<_>>()
        }
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty;;$n:expr) => {
        (0..$n).map(|_| scan!($t;;)).collect::<Vec<_>>()
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    scan!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    scan!($($t),*)
        ).collect::<Vec<_>>()
    };
}

const MOD: i64 = 1_000_000_007;

fn main() {
    let (h, w) = scan!(usize, usize);
    let graph = scan!(;;h);
    let mut nums = vec![vec![0; w]; h];
    nums[0][0] = 1;

    let mut q = VecDeque::new();
    q.push_back((0, 0));
    while let Some((x, y)) = q.pop_front() {
        if !(x == 0 && y == 0) && nums[x][y] != 0 {
            continue;
        }

        if x + 1 < h && graph[x + 1].chars().nth(y).unwrap() != '#' {
            q.push_back((x + 1, y))
        }
        if y + 1 < w && graph[x].chars().nth(y + 1).unwrap() != '#' {
            q.push_back((x, y + 1))
        }

        if !(x == 0 && y == 0) {
            nums[x][y] =
                if x >= 1 { nums[x - 1][y] } else { 0 } + if y >= 1 { nums[x][y - 1] } else { 0 };
            nums[x][y] %= MOD;
        }
    }
    println!("{}", nums[h - 1][w - 1])
}
//  [rust]
#[allow(unused_imports)]
use std::collections::VecDeque;
#[allow(unused_imports)]
use std::cmp;
#[allow(unused_imports)]
use std::collections::HashMap;

#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        #[allow(unused_variables)]
        #[allow(unused_mut)]
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
 
    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
 
    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };
 
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
 
    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };
 
    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };
 
    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("parse error")
    };
}

fn main() {
    input!{
        h: usize,
        w: usize,
        m: [chars; h]
    }
    let mut graph = vec![vec![]; h * w];
    for i in 0..h {
        for j in 0..w {
            let n = m[i][j];
            if n == '#' {continue;}
            if j < w-1 { graph[i * w + j].push(i * w + j + 1); }
            if i < h-1 { graph[i * w + j].push((i+1) * w + j); }
        }
    }
    let f = |a: i64, b: i64| (a + b) % 1000000007;
    let mut maps: Vec<i64> = vec![0; h * w];
    maps[0] = 1;
    for ind in 0..h*w {
        for &v in &graph[ind] {
            maps[v] = f(maps[v], maps[ind]);
        }
    }
    println!("{}", maps[h * w - 1]);
}
//  [rust]
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};

#[allow(unused_imports)]
use std::io::Write;
use std::collections::VecDeque;

const MOD:usize = 1e9 as usize + 7;

fn main() {
    input!{
      h: usize,
      w: usize,
      aa: [chars; h],
    }
    let mut dp = vec![vec![0; w+1]; h+1];
    dp[0][0] = 0;
    dp[0][1] = 1;
    dp[1][0] = 0;

    let mut q = VecDeque::new();
    q.push_back((1, 1));

    while let Some((x, y)) = q.pop_front() {
        if aa[x-1][y-1] == '#' {
            continue;
        }
        if dp[x][y] != 0 {
            continue;
        }
        dp[x][y] = (dp[x-1][y] + dp[x][y-1]) % MOD;

        if x+1 <= h {
            q.push_back((x+1, y));
        }
        if y+1 <= w {
            q.push_back((x, y+1));
        }
    }
    println!("{}", dp[h][w]);
}
//  [swift]
let mod = 1000000007
let input = readLine()!.split(separator: " ").map { Int($0)! }

let H = input[0]
let W = input[1]

var grid: [[Character]] = .init(repeating: .init(repeating: "@", count: W), count: H)

for h in 0..<H {
  grid[h] = Array(readLine()!)
}

var dp: [[Int]] = .init(repeating: .init(repeating: 0, count: W + 1), count: H + 1)
dp[0][0] = 1
for row in 1...H {
  for col in 1...W {
    if grid[row - 1][col - 1] == "#" {
      dp[row][col] = 0
      continue
    }
    if row == 1 && col == 1 {
      dp[row][col] = 1
      continue
    }
    dp[row][col] = (dp[row - 1][col] + dp[row][col-1]) % mod
  }
}
print(dp[H][W])
//  [swift]
/// Swift5 -> Swift2.2

extension String {
    // split(separator:maxSplits:omittingEmptySubsequences:)
    func split(separator separator: Character) -> [String] {
        return self.characters.split(separator).map(String.init)
    }
}
extension Array {
    // init(repeating:count:)
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
    // lastIndex(where:)
    func lastIndex(where predicate: (Element) -> Bool) -> Int? {
      	for i in stride(from: count - 1, through: 0, by: -1) {
          	if predicate(self[i]) {
              	return i
            }
        }
      	return nil
    }
}
extension Array where Element: Comparable {
    // sorted()
    func sorted() -> [Element] {
        return self.sort( { $0 < $1 } )
    }
    // max()
    func max() -> Element? {
        guard self.count > 0 else { return nil }
        return self.reduce(self.first!) { return Swift.max($0, $1) }
    }
}
extension String {
    // Sequence#enumerated()
  	// public func enumerate<Seq : SequenceType>(base: Seq) -> EnumerateSequence<Seq>
    func enumerated() -> EnumerateSequence<[Character]> {
        return Array(self.characters).enumerate()
    }
}
// stride(from:through:by:)
func stride(from start: Int, through end: Int, by stride: Int) -> StrideThrough<Int> {
    return start.stride(through: end, by: stride)
}
// stride(from:to:by)
func stride(from start: Int, to end: Int, by stride: Int) -> StrideTo<Int> {
    return start.stride(to: end, by: stride)
}

/// end

let input = readLine()!.split(separator: " ").map { Int($0)! }
let H = input[0]
let W = input[1]

var dp = Array(repeating: 0, count: W)
dp[0] = 1

enum Grid: Character {
    case empty = "."
    case wall = "#"
}

for i in stride(from: 0, to: H, by: 1) {
    for (j, character) in readLine()!.enumerated() {
        guard i > 0 || j > 0 else { continue }
        switch Grid(rawValue: character)! {
        case .empty:
            if j > 0 {
                dp[j] = (dp[j - 1] + dp[j]) % 1_000_000_007
            }
        default:
            dp[j] = 0
        }
    }
}

print(dp.last!)
//  [typescript]
'use strict';
process.stdin.resume();
process.stdin.setEncoding('utf8');

// Your code here!
const max = (a)=>{
    let i = a.length;
    let max=-Infinity;
    while (i--) {
        if (a[i] > max)max = a[i];
    }
    return max;
}
const min = (a)=>{
    let i = a.length;
    let max=Infinity;
    while (i--) {
        if (a[i] < max)max = a[i];
    }
    return max;
}
const Main = (p)=>{
	p = p.split("\n");//2 or more
	//const s=p[0];
	//const t=p[1];
	//const N = parseInt(p[0]);//N
    const H = parseInt(p[0].split(" ")[0]);//N M
	const W = parseInt(p[0].split(" ")[1]);//N M
	//const h = (p[1].split(" ").map(Number));//a1 a2 a3...
	const a = new Array(H);
	const w = new Array(H);
	for(let i=0;i<H;i++){
	    a[i] = p[i+1].split("");
	    w[i] = new Array(W).fill(-1);
	    w[i][0]=0;
	}
	w[0].fill(0);
	for(let j=0;j<W;j++)if(a[0][j]==="#")break;else w[0][j]=1;
	for(let i=0;i<H;i++)if(a[i][0]==="#")break;else w[i][0]=1;
	//console.log(H,W,a,w)
	
    for(let i=1;i<H;i++){
	    for(let j=1;j<W;j++){
	        if(a[i][j]==="#")w[i][j]=0;else
	        w[i][j]=w[i-1][j]+w[i][j-1];
	        w[i][j]%=1000000007;
	    }   
	}
	console.log(w[H-1][W-1]);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [python]
# -*- coding: utf-8 -*-

import sys
import subprocess
import json
import time
import math
import re
import sqlite3

r, g, b = map(int, input().split())
if (g*10 + b) % 4 == 0: print("YES")
else: print("NO")
//  [python]
r,g,b, = map(str, raw_input().split())
s = int(r+g+b)
print 'YES' if s % 4 == 0 else 'NO'
//  [python]
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    a=int(ST().replace(" ",""))
    if a%4:
        print("NO")
    else:
        print("YES")
if __name__ == '__main__':
    main()
//  [java]
import java.util.Scanner;

/**
 * https://abc064.contest.atcoder.jp/tasks/abc064_a
 */
public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		String r = sc.next();
		String g = sc.next();
		String b = sc.next();
		sc.close();
		
		int num = Integer.parseInt(r+g+b);
		
		String ans = num % 4 == 0 ? "YES" : "NO";
		System.out.println(ans);
		

	}

}
//  [java]
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Deque;
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {
  public static void main(String[] args) {
    Deque<Integer> list = new ArrayDeque<>(Arrays.asList(2,1,0));
    try (Scanner sc = new Scanner(System.in)) {   
      int sum = Stream.of(sc.nextLine().split(" "))
                      .map(Integer::valueOf)
                      .reduce(0, (x, y) -> x + y * (int) Math.pow(10,list.removeFirst()));
      System.out.println((sum % 4 == 0) ? "YES" : "NO");
    }
  }
}
//  [java]
import java.io.*;
import java.lang.*;
import java.util.*;
import java.math.*;

class Main{
	static int imax=Integer.MAX_VALUE;
	static long lmax=Long.MAX_VALUE;
	
	public static void main(String[] args) throws FileNotFoundException{
	
		Scanner sc=new Scanner(System.in);
		int[] num=readlnI(sc," ");
		int n=num[0]*100+num[1]*10+num[2];
		puts( n%4==0 ? "YES" : "NO");
		}//main_end
	
	//utility
	static int readI(Scanner sc){
		return Integer.parseInt(sc.nextLine().trim());
	}
	static long readL(Scanner sc){
		return Long.parseLong(sc.nextLine().trim());
	}
	static String readS(Scanner sc){
		return sc.nextLine().trim();
	}
	static int[] readlnI(Scanner sc, String dl){
		return Arrays.stream(sc.nextLine().trim().split(dl)).mapToInt(Integer::parseInt).toArray();
	}
	static long[] readlnL(Scanner sc, String dl){
		return Arrays.stream(sc.nextLine().trim().split(dl)).mapToLong(Long::parseLong).toArray();
	}
	static String[] readlnS(Scanner sc, String dl){
		return sc.nextLine().trim().split(dl);
	}
	@SuppressWarnings("unchecked")
	static <T> void puts(T... args){
		for(int i=0; i<args.length-1; i++){
			System.out.printf("%s ",args[i]);
		}
		System.out.println(args[args.length-1]);
	}
	static void puts(int[] ary){
		for(int i=0; i<ary.length-1; i++){
			System.out.printf("%d ",ary[i]);
		}
		System.out.println(ary[ary.length-1]);
	}
	static void puts(long[] ary){
		for(int i=0; i<ary.length-1; i++){
			System.out.printf("%d ",ary[i]);
		}
		System.out.println(ary[ary.length-1]);
	}
	static void bs(){
		System.out.println("");
	}
	static void tblSort(int[][] tbl){
		Arrays.sort(tbl, new Comparator<int[]>(){
			@Override
			public int compare(int[] a, int[] b){
				if(a[0]==b[0]){
					return b[1]-a[1];
				}else{
					return b[0]-a[0];
				}
			}
		});
	}
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
const int mod=1e9+7;
 
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
 
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
 
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
 
    return true;
}
 
map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
 
void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}
 
int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  
  int r,g,b;cin>>r>>g>>b;
  int total=r*100+g*10+b;
  string ans="NO";
  if(total%4==0)ans="YES";
  cout(ans);
  
  return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

#define int long long
#define inf 1000000007LL

#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = (n) - 1LL; i >= 0; i--)
#define trep(i, n) for(int i = 0; i <= (n); i++)
#define rep1(i, n) for(int i = 1LL; i <= (n); i++)
#define mfor(i, s, t) for(int i = (s); i < (t); i++)
#define tfor(i, s, t) for(int i = (s); i <= (t); i++)
/*
class Dinic {
public:
  vector<vector<pair<int, int>>> v;
  vector<int> e;

  vector<int> k;
  vector<int> j;

  void init(int n) {
    v = vector<vector<pair<int, int>>>(n);
    e = vector<int>();
    k = vector<int>(n);
    j = vector<int>(n);
  }
  void add_edge(int a, int b, int atob, int btoa = 0) {
    v[a].push_back(make_pair(b, e.size()));
    e.push_back(atob);
    v[b].push_back(make_pair(a, e.size()));
    e.push_back(btoa);
  }
  void dyk(int s) {
    for(auto& i : k) {
      i = inf;
    }
    queue<pair<int, int>> pq;
    pq.push(make_pair(0, s));
    while(!pq.empty()) {
      int w = pq.front().first;
      int b = pq.front().second;
      pq.pop();
      if(k[b] > w) {
        k[b] = w;
        for(auto i : v[b]) {
          if(e[i.second] > 0) {
            pq.push(make_pair(w + 1LL, i.first));
          }
        }
      }
    }
  }
  int dfs(int s, int t, int p, int c) {
    if(p == t) {
      return c;
    }
    int all = 0;
    while(c > all && j[p] < v[p].size()) {
      if(k[v[p][j[p]].first] == k[p] + 1LL) {
        int r = dfs(s, t, v[p][j[p]].first, min(c - all, e[v[p][j[p]].second]));
        e[v[p][j[p]].second] -= r;
        e[v[p][j[p]].second ^ 1LL] += r;
        if(r < c - all) {
          j[p]++;
        }
        all += r;
      }
      else {
        j[p]++;
      }
    }
    return all;
  }
  int solve(int s, int t) {
    int all = 0;
    while(1LL) {
      dyk(s);
      for(auto& i : j) {
        i = 0;
      }
      int r = dfs(s, t, s, inf);
      if(r == 0) {
        return all;
      }
      all += r;
    }
  }
};
*/

signed main() {
  int a, b, c;
  cin >> a >> b >> c;
  if((a * 100 + b * 10 + c) % 4 == 0) {
    cout << "YES" << endl;
  }
  else {
    cout << "NO" << endl;
  }
}
//  [cpp]
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
using namespace std;

int main() {
    int r, g, b;
    cin >> r >> g >> b;
    
    int sum = 100 * r + 10 * g + b;
    
    if ( sum % 4 == 0 ) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    
    return 0;
}
//  [c]
#include<stdio.h>
int main()
{
    int r,g,b, result;
    scanf("%d %d %d",&r ,&g, &b);
    result = 100*r + 10*g +b;
    if( result%4==0 )
    {
         printf("YES");
    }
    else
    {
         printf("NO");
    }
    return 0;
}
//  [c]
#include<stdio.h>

int main()
{
    int a,b,c,m;
    scanf("%d %d %d",&a,&b,&c);
    if(1<=a && a<=9 && 1<=b && b<=9 && 1<=c && c<=9)
    {
       m=100*a+10*b+c;
       if(m%4==0) printf("\nYES");
        else printf("\nNO");
    }

    return 0;
}
//  [c]

#pragma warning(disable:4996)

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <float.h>

#pragma region 定義
typedef long long  ll;
typedef unsigned long long  ull;


#define _itoa(A,N) sprintf(A, "%d", N);

int i_dsort(const void* a, const void* b);
int i_asort(const void* a, const void* b);

int  _gcd(int a, int b);
int  _swp(int* a, int* b);
int _cknum(char* a, int n);
int _atoi(char* s, int len);

int s_asort(const void* a, const void* b);
int s_dsort(const void* a, const void* b);

//昇順
int s_asort(const void* a, const void* b) {
	return(strcmp((char*)a, (char*)b));
}
int s_dsort(const void* a, const void* b) {
	return(strcmp((char*)b, (char*)a));
}

int i_dsort(const void* a, const void* b) {
	return(*(int*)b - *(int*)a);
}
int i_asort(const void* a, const void* b) {
	return(*(int*)a - *(int*)b);
}


int i_gcd(int a, int b);
int i_gcd(int a, int b) {
	if (!b)return a;
	return i_gcd(b, a % b);
}
int i_lcm(int a, int b);
int i_lcm(int a, int b) {
	return (a * b) / i_gcd(a, b);
}
int ll_gcd(ll a, ll b);
int ll_gcd(ll a, ll b) {
	if (!b)return a;
	return ll_gcd(b, a % b);
}
int ll_lcm(ll a, ll b);
int ll_lcm(ll a, ll b) {
	return (a * b) / ll_gcd(a, b);
}

// puts("Yes\n") puts("No\n")
// scanf("%d.%d") 浮動小数点入力を整数２つで得る


//#define pai  3.1415926535 
//#define  _USE_MATH_DEFINES でM_PIが使える

#define deg_rad(X)  (X*(M_PI/180))


int _swp(int* a, int* b)
{
	int tmp;
	tmp = *b; *b = *a; *a = tmp;
	return 0;
}
#define _abs(x) ((x)>0?(x):-(x))
#define _min(x,y) ((x)<(y)?(x):(y))
#define _max(x,y) ((x)<(y)?(y):(x))

int _cknum(char* a, int n) {
	int i;
	char t = '0';

	for (i = 0; i < n; i++) {
		if (a[i] < '0' || a[i]>'9') return 1;
	}
	return 0;
}


int _atoi(char* s, int len) {
	char tmp[20];
	memcpy(tmp, s, len);
	tmp[len] = 0x00;
	return (atoi(tmp));
}

//素因数分解　pf素数が入る　pc 素数の数
//ll _pfact(ll a);
//static ll pf[100000000];
//static ll pc;
//
//ll _pfact(ll a) {
//	long i, r;
//	if (a % 2 == 0) {
//		pf[pc] = 2; pc++;
//		return(_pfact(a / 2));
//	}
//	r = sqrt(a);
//	for (i = 3; i <= r; i += 2) {
//		if (a % i == 0) {
//			pf[pc] = i; pc++;
//			return(_pfact(a / i));
//		}
//	}
//	if (a != 1) {
//		pf[pc] = a; pc++;
//	}
//	return 0;
//
//}

//同じものの最初の文字をNULLにして降順
int _sort(const void* a, const void* b);
int _sort(const void* a, const void* b) {
	char rc;

	rc = strcmp((char*)b, (char*)a);
	if (rc == 0) {
		*(char*)a = 0x00;
		return(1);
	}
	return(rc);
}
// 立っている ビットの数
int bitcount(unsigned int uc);
int bitcount(unsigned int uc)
{
	int bit;

	for (bit = 0; 0 != uc; uc = (unsigned int)(uc >> 1))
		if (0 != (uc & 1))++bit;

	return bit;
}//bitco

#pragma endregion

// ABC064 A-RGB Cards

int main(void) {
	int r,g,b;
	
	scanf("%d %d %d", &r, &g,&b);
	((r * 100 + g * 10 + b)%4)?printf("NO\n"):printf("YES\n");
	return 0;
}
//  [javascript]
function Main(input) {
    input = input.split("\n");
    var line = input[0].split(" ");
    var num = 100*parseInt(line[0])+10*parseInt(line[1])+parseInt(line[2]);
    

    if(num%4===0){
        console.log("YES");
    } else {
        console.log("NO");
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
  input = input.trim();
  const a = input.split(" ").map(Number);
  const str_num = a.join('');
  if(Number(str_num)%4==0){
    console.log("YES");
  }else{
    console.log("NO");
  }
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input){
  input = input.split(' ');
  var r = input[0];
  var g = input[1];
  var b = input[2];
  var rgb = Number(r + g + b);


  if( rgb % 4 === 0) {
      console.log('YES');
  } else {
      console.log('NO');
  }

}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func Scanner() string {
	sc.Scan()
	return sc.Text()
}

func intScanner() int {
	n, _ := strconv.Atoi(Scanner())
	return n
}

func floatScanner() float64 {
	n, _ := strconv.ParseFloat(Scanner(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func stringSliceScanner(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scanner()
	}
	return a
}
func intSliceScanner(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = intScanner()
	}
	return a
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	r, g, b := intScanner(), intScanner(), intScanner()
	if (r*100+g*10+b)%4 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
//  [ruby]
puts gets.gsub(/\s/, "").to_i % 4 == 0 ? :YES: :NO
//  [ruby]
r,g,b = gets.chomp.split(" ").map(&:to_i)
puts (r * 100 + g * 10 + b) % 4 == 0 ? "YES" : "NO"
//  [ruby]
r, g, b = gets.split.map(&:to_i)
ans = 100 * r + 10 * g + b
puts ans % 4 == 0 ? "YES" : "NO"
//  [rust]
#![allow(non_snake_case)]
#![allow(unused_imports)]

use proconio::{input, fastout};
use proconio::marker::*;
use whiteread::parse_line;
use std::collections::*;
use num::*;
use num_traits::*;
use superslice::*;
use std::ops::*;

use itertools::Itertools;
use itertools_num::ItertoolsNum;

fn main() {
    input!{
        r: String, g: String, b: String,
    }

    let rgb = format!("{}{}{}", r, g, b).parse::<usize>().unwrap();

    if rgb % 4 == 0 {
        println!("YES")
    } else {
        println!("NO")
    }
}
//  [rust]
fn main() {
	proconio::input!{
		r: usize,
		g: usize,
		b: usize,
	}

	if (r*100+g*10+b) % 4 == 0 {
		println!("YES");
	}
	else {
		println!("NO");
	}
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [r, g, b] = input[0];

  return Number(`${r}${g}${b}`) % 4 === 0 ? "YES" : "NO";
};

console.log(main(read()));
//  [typescript]
function Main(input) {
    input = input.split('\n');
    var num = Number(input[0].split(' ').join(''))
    console.log(num % 4 === 0 ? 'YES' : 'NO');
    
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let a=nin()*100+nin()*10+nin()
  out(a%4==0?'YES':'NO')
}
main()
//  [python]
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
print(700 + Counter(rs())['o'] * 100)
//  [python]
sl = list(input())

ans = 700 + 100*sl.count('o')
print(ans)
//  [python]
s=input()
print(700+s.count("o")*100)
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        String s = cin.next();
        long n = s.chars().filter(x -> x == 'o').count();
        System.out.println(700 + n * 100);
    }
}
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int s = in.nextLine().chars().filter(value -> value == 'o').map(operand -> 100).sum();
        System.out.println(s + 700);
    }
}
//  [java]
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();
		int ans = 700;
		if(S.charAt(0)=='o')ans+=100;
		if(S.charAt(1)=='o')ans+=100;
		if(S.charAt(2)=='o')ans+=100;
		System.out.println(ans);
	}
}
//  [cpp]
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <iostream>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <vector>
#define mem(a, b) memset(a, (b), sizeof(a))

using namespace std;


typedef long long ll;
const int Maxn = 1e9 + 10;
const int N = 1e6 + 10;
const int INF=(0x7fffffff)/2;
const int MOD = 1000000007;
const int MaxN = 1000;

char s[10];

int main(){
	scanf("%s", s);
	int sum = 700;
	for(int i = 0; i < 3; i++){
		if(s[i] =='o')
			sum += 100;
	}
	printf("%d\n",sum);
}