jiahuimbzuai/CoQuIR huggingface dataset:
//  [cpp]
//Zory-2020
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
// typedef __int128 ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define FR first
#define SE second
#define MP make_pair
#define PB push_back
#define vc vector
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define bin(x) (1ll<<(x))
#define fo(i,l,r) for(int i=(l),I=(r);i<=I;i++)
#define fd(i,r,l) for(int i=(r),I=(l);i>=I;i--)
#define mem(x,val) memset(x,val,sizeof x)
#define Swap(a,b,n) for(int I=0;I<=n;I++) swap(a[I],b[I])
#define PC __builtin_popcountll
#ifdef DEBUG
#define DD 1
#else
#define DD 0
#endif
#define Debug if(DD) printf("line %d\n",__LINE__)
#define deb(x) if(DD) cerr<<#x<<'='<<x<<endl
#define debug if(DD) printf
namespace mine
{
	ll qread()
	{
		ll ans=0,f=1;char c=getchar();
		while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();}
		while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar();
		return ans*f;
	}
	void write(ll num){if(num<0) putchar('-'),num=-num;if(num>=10) write(num/10);putchar('0'+num%10);}
	void write1(ll num){write(num);putchar(' ');}
	void write2(ll num){write(num);putchar('\n');}
	template<typename T>inline bool chmax(T&a,const T&b){return a<b?a=b,1:0;}
	template<typename T>inline bool chmin(T&a,const T&b){return a>b?a=b,1:0;}
	ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
	bool IN(ll x,ll l,ll r){return l<=x and x<=r;}
	void gg1(){write2(-1);exit(0);}
	void gg2(){puts("NO");exit(0);}
	
	const double eps=1e-8;
	const int INF=0x3f3f3f3f;
	const int MOD=1e9+7;
	int mm(const int x){return x>=MOD?x-MOD:x;}
	template<typename T> void add(T &x,const int &y){x=(x+y>=MOD?x+y-MOD:x+y);}
	ll qpower(ll x,ll e,int mod=MOD){ll ans=1;while(e){if(e&1)ans=ans*x%mod;x=x*x%mod;e>>=1;}return ans;}
	ll invm(ll x){return qpower(x,MOD-2);}
	const int M=5e6+10;
	ll fac[M],facinv[M];ll C(int n,int m){return n<0 or n<m?0:fac[n]*facinv[m]%MOD*facinv[n-m]%MOD;}
	void PRE()
	{
		fac[0]=1;fo(i,1,M-1) fac[i]=fac[i-1]*i%MOD;
		facinv[M-1]=invm(fac[M-1]);fd(i,M-1,1) facinv[i-1]=facinv[i]*i%MOD;
	}
	
	const int N=1e6+10;
	int x[N];
	void main()
	{PRE();
		int n=qread(),R=qread();int ans;
		if(n<=10) ans=R+100*(10-n); else ans=R;write(ans);
	}
};//变量重名！
signed main()
{
	#ifdef DEBUG
	//freopen("a.in","r",stdin);
	freopen("z.txt","r",stdin);
	#endif
	srand(time(0));
	mine::main();
	if(DD) cerr<<"\n---------------------Zory-------------------\nTime: " <<1.0*clock()/CLOCKS_PER_SEC<<"s";
}
//  [c]
#include<stdio.h>
int main()
{
    int n=0,r=0,z=0,sum=0;
    scanf("%d%d",&n,&r);
    
    if(n>=10){
        printf("%d",r);
    }else{
        z=100*(10-n);
        sum=z+r;
        printf("%d",sum);
    }
    
    return 0;
}
//  [c]
#include <stdio.h>
int main()
{
    int a,b,sum;
    scanf("%d%d",&a,&b);
    if(a<10) sum=b+100*(10-a);
    else sum=b;
    printf("%d",sum);
    return 0;
}
//  [c]
#include<stdio.h>
int main()
{
    int n,r;
    scanf("%d%d",&n,&r);
    if(n>=10)
    {
        printf("%d\n",r);
    }
    else
    {
        int s=r+100*(10-n);

        printf("%d\n",s);
    }
    return 0;
}
//  [javascript]
var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input,
  "index" : 0,
  "max" : input.length,
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  },
  "hasNext" : function(){return (this.index < this.max);}
}
Main();
function next(){return obj.next();}
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[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 = myconv(next(),4);
  var N = one[0];
  var R = one[1];
  if(N >= 10){
     myout(R);
   }else{
     myout(R + (100 * (10 - N)));
   }
}
//  [javascript]
function main(input) {
    var a = input[0].split(" ")[0]-0;
    var b = input[0].split(" ")[1]-0;
    console.log(a>=10?b:(100*(10-a)+b));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
  input = input.split("\n")[0];
  const N = parseInt(input.split(' ')[0])
  const R = parseInt(input.split(' ')[1])
if(N >= 10){
  console.log(R)
}else{
  console.log(R + 100*(10 - N))
}
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"fmt"
)

func main() {

	var N, R int
	fmt.Scanf("%d %d", &N, &R)

	if N >= 10 {
		fmt.Println(R)
	} else {
		fmt.Println(R + 100*(10-N))
	}

}
//  [go]
package main
import "fmt"
func main(){
  var N,R int
  fmt.Scan(&N,&R)
  if N<10{
    fmt.Println(R+100*(10-N))
  }else{
    fmt.Println(R)
  }
}
//  [ruby]
x,y=gets.split.map!(&:to_i)
if x>=10
  puts y
else
  puts y+100*(10-x)
end
//  [ruby]
n,r=gets.split.map &:to_i
p r+100*[0,10-n].max
//  [ruby]
n,r = gets.chomp.split(" ").map(&:to_i);

ans = 0
if n<10 then
	ans = 100*(10-n) + r
else
	ans = r
end

puts ans
//  [swift]
import Foundation

/*
// 1
let N = Int(readLine()!)!

// 1 2
let split = readLine()!.componentsSeparatedByString(" ")
let N = Int(split[0])!
let S = Int(split[1])!

// 1 2 3 4 5
let array = readLine()!.componentsSeparatedByString(" ").map { Int($0)! }
*/

let split = readLine()!.componentsSeparatedByString(" ")
let N = Int(split[0])!
let R = Int(split[1])!

if N < 10 {
  print(R + (100 * (10 - N)))
} else {
  print(R)
}
//  [swift]
import Foundation

// 1
//let N = Int(readLine()!)!

// 1 2
let split = readLine()!.componentsSeparatedByString(" ")
let N = Int(split[0])!
let R = Int(split[1])!

if N < 10 {
  print(R + (100 * (10 - N)))
} else {
  print(R)
}
// 1 2 3 4 5
//let array = readLine()!.componentsSeparatedByString(" ").map { Int($0)! }
//  [typescript]
import * as fs from 'fs';
// main
function main(input: string[]) {
    // param
    let n;
    let r;
    let ans;
    // init
    // <example>
    [n, r] = input.shift().split(" ").map(x => Number(x));
    // solve
    if (10 <= n) {
        ans = r;
    } else {
        ans = r + 100 * (10 - n);
    }
    // answer
    console.log(ans);
}
// entrypoint
function entrypoint() {
    try {
        // linux
        let input = fs.readFileSync("/dev/stdin", "utf8").trim().split("\n");
        console.debug = function () { };
        main(input);
    }
    catch (ex) {
        // windows
        const lines: string[] = [];
        // @ts-ignore
        const reader = require('readline').createInterface({
            // @ts-ignore
            input: process.stdin,
            // @ts-ignore
            output: process.stdout
        });
        reader.on('line', function (line: string) {
            lines.push(line);
        });
        reader.on('close', function () {
            let input = lines;
            main(input);
        });
    }
}
entrypoint();
//  [typescript]
class AtCoder {
  // 入力系
  input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);
  input_i=-1;

  n(){
    this.input_i++;
    return Number(this.input[this.input_i]);
  }
  nn(n:number):number[]{
    const a=[];
    for(let i=0;i<n;i++){
      a.push(this.n());
    }
    return a;
  }
  s(){
    this.input_i++;
    return String(this.input[this.input_i]);
  }
  ss(n:number):string[]{
    const a=[];
    for(let i=0;i<n;i++){
      a.push(this.s());
    }
    return a;
  }

  // コンソール
  o(...a:any){
    console.log(...a);
  }

  // Math
  abs(a:number){
    return Math.abs(a);
  }
  min(...a:number[]){
    return Math.min(...a);
  }
  max(...a:number[]){
    return Math.max(...a);
  }
  floor(a:number){
    return Math.floor(a);
  }
  ceil(a:number){
    return Math.ceil(a);
  }
  round(a:number){
    return Math.round(a);
  }

  // ソート
  asc(ar:number[]){
    const t=[...ar];
    ar.sort((a,b)=>{return a-b});
  }
  desc(ar:number[]){
    const t=[...ar];
    ar.sort((a,b)=>{return b-a});
  }

  // 自作
  gcd(...arr:number[]):number{
    for(let i=0;i<arr.length-1;i++){
      let [x,y]=[arr[i],arr[i+1]];
      while(y){
        [x,y]=[y,x%y];
      }
      arr[i+1]=x;
    }
    return arr[arr.length-1];
  };
  lcm(...arr:number[]):number{
    for(let i=0;i<arr.length-1;i++){
      let [x,y]=[arr[i],arr[i+1]];
      while(y){
        [x,y]=[y,x%y];
      }
      arr[i+1]=arr[i]*arr[i+1]/x;
    }
    return arr[arr.length-1];
  };
  isPrime(n:number):boolean{
    if(n < 2) return false;
    const suq=Math.sqrt(n);
    for(let i=2;i<=suq;i++){
      if(n%i==0){
        return false;
      }
    }return true;
  };
  deduplicate(a:any[]):any[]{
    return Array.from(new Set(a));
  };
  f(roop:number, callback:any){
    for(let i=0;i<roop;i++){
      callback(i);
    }
  };
  Yes(){
    console.log('Yes');
  }
  No(){
    console.log('No');
  }
  YES(){
    console.log('YES');
  }
  NO(){
    console.log('NO');
  }
}
const m = () => {
  const o = new AtCoder();
  let [n, r] = o.nn(2);
  if(n>=10){
    o.o(r);
  }else{
    o.o(r+100*(10-n));
  }
}
m();
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
const [n, r] = input[0].split(" ").map((x: string): number => +x);

console.log(r + 100 * Math.max(0, 10 - n));
//  [python]
import sys
import os
import time

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = iss()
    key = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
    time.sleep(1.98)
    print(7 - key.index(S))


if __name__ == '__main__':
    main()
//  [python]
import os
import numpy as np

class getStdin(object):
    @classmethod
    def get_str(cls):
        return str(input())


if __name__ == '__main__':
    n = getStdin.get_str()
    a = ['', 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
    print(a.index(n))

    os.sys.exit(0)
//  [python]
# -*- coding: utf-8 -*-
"""
AtCoder A
"""

import sys, math, random
import numpy as np

# N = int(input())
# A = list(map(int,input().split())) # N row 1 column
# A = [int(input()) for _ in range(N)] # 1 row N column
# S = str(input()) # str(input()) == input() -> 'abc'
# S = list(input()) # abc -> ['a','b','c']
# S.replace('ABC','X') # "testABCABC" -> "testXX"
# S=numpp.assaray(S)=="#"
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LLS(): return [list(sys.stdin.readline().rstrip()) for _ in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()



def main():
    A=S()
    if A=="SUN":
        print(7)
    elif A=="MON":
        print(6)
    elif A=="TUE":
        print(5)
    elif A=="WED":
        print(4)
    elif A=="THU":
        print(3)
    elif A=="FRI":
        print(2)
    elif A=="SAT":
        print(1)




if __name__ == "__main__":
    main()
//  [java]
import java.io.InputStream;
import java.util.Scanner;
import java.util.stream.*;

public class Main {
  public static void main(String[] args){
    System.out.println(new Main().excute(System.in)); 
  }
  public String excute(InputStream f) {
    Scanner scan = new Scanner(f);
    String s =  scan.next();

    String[] w = {"SUN","MON","TUE","WED","THU","FRI","SAT"};

    return "" + (7 - IntStream.range(0, w.length)
                .filter(i ->  w[i].equals(s))
                .sum());
  }
}
//  [java]
import java.util.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String[] data = {"SAT","FRI","THU","WED","TUE","MON","SUN"};
    for (int i = 0; i < 7; i++) {
      if (data[i].equals(s)) {
        System.out.println(i+1);
      }
    }

  }

}
//  [java]

import java.time.DayOfWeek;
import java.time.format.TextStyle;
import java.util.Scanner;
import java.util.Arrays;
import java.util.Locale;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        String[] dayoftheweek = new String[8];
        String str = scanner.nextLine();
        int result = 7;

        for(int i = 1; i <= 7; i++) {
            dayoftheweek[i] = DayOfWeek.of(i).getDisplayName(TextStyle.SHORT_STANDALONE, Locale.US).toUpperCase();
            if (dayoftheweek[i].equals(str) != dayoftheweek[i].equals("SUN")) {
                result = 7 - i;
                break;
            }
        }
        System.out.println(result);
    }
}
//  [cpp]
#include <iostream>
#include <array>
#include <algorithm>
#include <map>
#include <vector>
#include <cmath>
#include <list>
#include <cmath>
#include <stack>
#include <queue>

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using namespace std;

const int mod = 1000000007;
struct mint {
	ll x; // typedef long long ll;
	mint(ll x = 0) :x((x% mod + mod) % mod) {}
	mint operator-() const { return mint(-x); }
	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 pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	// for prime mod
	mint inv() const {
		return pow(mod - 2);
	}
	mint& operator/=(const mint a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint a) const {
		mint res(*this);
		return res /= a;
	}
};

struct combination {
	vector<mint> fact, ifact;
	combination(int n) :fact(n + 1), ifact(n + 1) {
		fact[0] = 1;
		for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
		ifact[n] = fact[n].inv();
		for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
	}
	mint operator()(int n, int k) {
		if (k < 0 || k > n) return 0;
		return fact[n] * ifact[k] * ifact[n - k];
	}
} comb(2000005);

mint g(int r, int c) {
	return comb(r + c + 2, r + 1) - 1;
}

int main()
{
	string str[7] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
	string s;
	cin >> s;
	for (int i = 0; i < sizeof(str) / sizeof(str[0]); i++)
	{
		string p = str[i];
		if (s == p)
		{
			cout << (7 - i) << endl;
			return 0;
		}
	}
}
//  [cpp]
#include <iostream>

using namespace std;

int main()
{
    string day;
    int n;
    cin >> day;

    if (day == "SUN")
    {
        n = 7;
    }
    else if (day == "MON")
    {
        n = 6;
    }
    else if (day == "TUE")
    {
        n = 5;
    }
    else if (day == "WED")
    {
        n = 4;
    }
    else if (day == "THU")
    {
        n = 3;
    }
    else if (day == "FRI")
    {
        n = 2;
    }
    else if (day == "SAT")
    {
        n = 1;
    }
    cout << n << '\n';

    return 0;
}
//  [c]
#include<stdio.h>
int main()
{
	char s[3];
	scanf("%s",s);
	if(s[0]=='S'&&s[1]=='U') printf("7\n");
	if(s[0]=='M') printf("6\n");
	if(s[0]=='T'&&s[1]=='U') printf("5\n");
	if(s[0]=='W') printf("4\n");
	if(s[0]=='T'&&s[1]=='H') printf("3\n");
	if(s[0]=='F') printf("2\n");
	if(s[0]=='S'&&s[1]=='A') printf("1\n");
	return 0;
}
//  [c]
#include<stdio.h>

int main(void){

char s[3];

scanf("%s",&s);

if(s[0]=='S'&&s[1]=='U'&&s[2]=='N'){printf("7");}
if(s[0]=='M'&&s[1]=='O'&&s[2]=='N'){printf("6");}
if(s[0]=='T'&&s[1]=='U'&&s[2]=='E'){printf("5");}
if(s[0]=='W'&&s[1]=='E'&&s[2]=='D'){printf("4");}
if(s[0]=='T'&&s[1]=='H'&&s[2]=='U'){printf("3");}
if(s[0]=='F'&&s[1]=='R'&&s[2]=='I'){printf("2");}
if(s[0]=='S'&&s[1]=='A'&&s[2]=='T'){printf("1");}


  return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>

int main()
{
  char S[7][4] = {"SUN","MON","TUE","WED","THU","FRI","SAT"};
  char s[4] = {};

  scanf("%s", s);
  for(int i=0; i<7; i++)
  {
    if( strcmp(s,S[i]) == 0 )
     printf("%d",(7-i) );
  }

  return 0;
}
//  [javascript]
"use strict";
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

console.log(main());
function main(){
  var s = o.a(1);
  var w = {SUN:7,MON:6,TUE:5,WED:4,THU:3,FRI:2,SAT:1};
  return w[s];
}
//  [javascript]
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}
function myout(t){console.log(t);}//standard output
//[no]param
//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i,no){switch(no){case 0:return i;case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));}}

function Main(input) {
  input = myconv(input,0);
  switch(input){
    case "SUN":
      myout("7");
      break;
    case "MON":
      myout("6");
      break;
    case "TUE":
      myout("5");
      break;
    case "WED":
      myout("4");
      break;
    case "THU":
      myout("3");
      break;
    case "FRI":
      myout("2");
      break;
    case "SAT":
      myout("1");
      break;
              }
}

Main(myin());
//  [javascript]
inp = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')
s = inp.shift()
d = ['SUN','MON','TUE','WED','THU','FRI','SAT']
a = d.indexOf(s)
console.log(7 - a)
//  [go]
package main

import (
	"fmt"
)

func main() {
	var s string
	fmt.Scan(&s)

	ans := -1
	switch s {
	case "SUN":
		ans = 7
	case "MON":
		ans = 6
	case "TUE":
		ans = 5
	case "WED":
		ans = 4
	case "THU":
		ans = 3
	case "FRI":
		ans = 2
	case "SAT":
		ans = 1
	}
	fmt.Println(ans)
}
//  [go]
package main

import "fmt"

func main() {
	var s string
	week := map[string]int{
		"SUN": 0,
		"MON": 1,
		"TUE": 2,
		"WED": 3,
		"THU": 4,
		"FRI": 5,
		"SAT": 6,
	}
	fmt.Scan(&s)
	fmt.Println(7 - week[s])
}
//  [ruby]
#exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']

require 'prime'

def inpf() a=gets.chomp.split(" ").map(&:to_f)end

def inps() a=gets.chomp.split(" ")end

def copy(a) Marshal.load(Marshal.dump(a)) end

def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end

def na(n,d=0) Array.new(n,d)end

def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end

def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end

def inp() a=gets.chomp.split(" ").map(&:to_i)end

def r_up(a, b) (a+b-1)/b end

def sum(a) a.inject(:+) end

def big(a,b) return (a>b)? a:b end

def small(a,b) return (a<b)? a:b end

s = gets.chomp
t = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
t.each.with_index do |ss,i|
  if ss == s
    p 7-i
  end
end


#777
//  [ruby]
require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

S = gets.chomp

arr = %w[SUN MON TUE WED THU FRI SAT]

puts 7 - arr.find_index { |x| x == S }
//  [ruby]
p ({SUN:7,MON:6,TUE:5,WED:4,THU:3,FRI:2,SAT:1}[gets.chomp.to_sym])
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {s: String};

    if s == "SUN" {
        println!("7")
    } else if s == "MON" {
        println!("6")
    } else if s == "TUE" {
        println!("5")
    } else if s == "WED" {
        println!("4")
    } else if s == "THU" {
        println!("3")
    } else if s == "FRI" {
        println!("2")
    } else {
        println!("1")
    }
}
//  [rust]
use text_io::*;
use std::process::exit;
use im_rc::HashMap;
use std::cmp::min;

fn main(){
    let mut a:String = read!();
    if a=="SUN" {
        println!("7");
    }
    if a=="MON" {
        println!("6");
    }
    if a=="TUE" {
        println!("5");
    }
    if a=="WED" {
        println!("4");
    }
    if a=="THU" {
        println!("3");
    }
    if a=="FRI" {
        println!("2");
    }
    if a=="SAT" {
        println!("1");
    }
}
//  [swift]
let a = readLine()!

let week: [String: Int] = ["SUN": 7, "MON": 6, "TUE": 5, "WED": 4, "THU": 3, "FRI": 2, "SAT": 1]

print(week[a]!)
//  [swift]
//
var wday: [String: Int]
wday = [:]

wday["SUN"] = 7
wday["MON"] = 6
wday["TUE"] = 5
wday["WED"] = 4
wday["THU"] = 3
wday["FRI"] = 2
wday["SAT"] = 1

//
let s:String = readLine()!
print(wday[s]!)
//  [swift]
print(7-["SUN","MON","TUE","WED","THU","FRI","SAT"].indexOf(readLine()!)!)
//  [typescript]
var lines=[];
var reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
const date = ['SUN','MON','TUE','WED','THU','FRI','SAT']
reader.on('line', function (line) {
  console.log(7 - date.indexOf(line))
  process.exit(0)
});
//  [typescript]
export class Main {
  main(input: string) {
    const tmp: string[] = input.split("\n");
    const s: string = tmp.shift();

    switch (s) {
      case 'SUN':
        return 7;
      case 'MON':
        return 6;
      case 'TUE':
        return 5;
      case 'WED':
        return 4;
      case 'THU':
        return 3;
      case 'FRI':
        return 2;
      case 'SAT':
        return 1;
    }
  }
}

console.log(new Main().main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [typescript]
"use strict";
function Main(input) {
  input = input.split("\n");
  var s = {
    "SUN": 7,
    "MON": 6,
    "TUE": 5,
    "WED": 4,
    "THU": 3,
    "FRI": 2,
    "SAT": 1,
  }
  console.log(s[input[0]]);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
a,b = map(int, raw_input().split())
print 'Possible' if a % 3 == 0 or b % 3 == 0 or (a+b)%3 == 0 else 'Impossible'
//  [python]
l=list(map(int,input().split()))
if(sum(l)%3==0 or l[0]%3==0 or l[1]%3==0):
    print('Possible')
else:
    print('Impossible')
//  [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
# endregion

A, B = ri_()
print('Possible' if A % 3 ==0 or B % 3 == 0 or (A + B) % 3 == 0 else 'Impossible')
//  [java]
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            br.lines()
                .map(line -> Arrays.stream(line.split(" "))
                        .mapToInt(Integer::parseInt)
                        .toArray())
                .forEach(tokens -> {
                    int a = tokens[0];
                    int b = tokens[1];
                	if(((a%3==0)||(b%3==0))||((a+b)%3==0))System.out.println("Possible");
                	else System.out.println("Impossible");
                });
        }
    }
}
//  [java]

import java.util.Scanner;

class Main{
        public static void main(String[] args){
                Scanner scanner=new Scanner(System.in);
                int a=scanner.nextInt();
                int b=scanner.nextInt();
                boolean b1=a%3==0;
                boolean b2=b%3==0;
                boolean b3=(a+b)%3==0;
                if(b1||b2||b3){
                        System.out.println("Possible");
                }else{
                        System.out.println("Impossible");
                }
        }
}
//  [cpp]
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main(void){
    int a,b;
    cin>>a>>b;
    if(a%3==0||b%3==0||(a+b)%3==0)cout<<"Possible"<<endl;
    else cout<<"Impossible"<<endl;
    return 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 a,b;cin>>a>>b;
  string ans="Impossible";
  if(a%3==0||b%3==0||(a+b)%3==0)ans="Possible";
  cout(ans);
  
  return 0;
}
//  [cpp]
#include <iostream>

using namespace std;

int main() {
        int A,B;
        cin >> A >> B;
        if (A%3 == 0 || B%3 == 0 || (A+B)%3 == 0)
                cout << "Possible\n";
        else
                cout << "Impossible\n";
}
//  [c]
#include <stdio.h>

int main()
{
    int x, b;
    scanf("%d %d", &x, &b);

    if( (x+b)%3==0 || x%3==0 || b%3==0 )
    {
        printf("Possible");
    }

    else
    {
        printf("Impossible");
    }
    return 0;
}
//  [c]
#include <stdio.h>
int a,b;//a=a盒顆數  b=b盒顆數
int main(void) {
scanf("%d%d",&a,&b);
if(a%3==0&b%3==0)
printf("Possible");
else if(a%3==0&b%3!=0)
printf("Possible");
else if(a%3!=0&b%3==0)
printf("Possible");
else if(a%3!=0&b%3!=0&(a+b)%3==0)
printf("Possible");
else
printf("Impossible");



return 0;
}
//  [c]
#include <stdio.h>

int main()
{
    int a, b;
    scanf("%d %d", &a, &b);

    if( (a+b)%3==0 || a%3==0 || b%3==0 )
    {
        printf("Possible");
    }

    else
    {
        printf("Impossible");
    }
    return 0;
}
//  [javascript]
function main( input ){

  input = input.split( /\s/ )

  var A = Number( input[0] ),
      B = Number( input[1] )

  if( ( A + B ) % 3 === 0 || A % 3 === 0 || B % 3 === 0 )
    console.log( 'Possible' )
  else
    console.log( 'Impossible' )

}

main(
  require( 'fs' )
    .readFileSync( '/dev/stdin', 'utf8' )
)
//  [javascript]
function main(input) {
  input = input.trim();
  const [a,b] = input.split(" ").map(Number);
 
  if(a%3==0 || b%3==0 || (a+b)%3==0){
    console.log("Possible");
  }else{
    console.log("Impossible");
  }
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const A = parseInt(args[0][0], 10)
	const B = parseInt(args[0][1], 10)
	if (A % 3 === 0 || B % 3 === 0 || (A + B) % 3 === 0) console.log('Possible')
	else console.log('Impossible')
}

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

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

func atoi(s string) int { v, _ := strconv.Atoi(s); return v }
func atou(s string) uint64 { v, _ := strconv.ParseUint(s, 10, 64); return v }
func atof(s string) float64 { v, _ := strconv.ParseFloat(s, 64); return v }
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 }

var (_ = fmt.Println; _red = bufio.NewScanner(os.Stdin); _tok []string)
func init() { _red.Buffer(make([]byte, 1e7), 1e7) }
func gettok() (t string, e bool) {
	if len(_tok) == 0 { if !_red.Scan() { return }; _tok = strings.Split(_red.Text(), " ") }
	t = _tok[0]; _tok = _tok[1:]; e = len(_tok) == 0; return
}
func read(vs ...interface{}) {
	for _, v := range vs {
		switch v := v.(type) {
		case *int: t, _ := gettok(); *v = atoi(t)
		case *int64: t, _ := gettok(); *v = int64(atou(t))
		case *uint64: t, _ := gettok(); *v = atou(t)
		case *float64: t, _ := gettok(); *v = atof(t)
		case *string: *v, _ = gettok()
		case *[]int:
			if len(*v) == 0 { for { t, e := gettok(); *v = append(*v, atoi(t)); if e { break } }
			} else { for j := range *v { t, _ := gettok(); (*v)[j] = atoi(t) } }
		case *[]int64:
			if len(*v) == 0 { for { t, e := gettok(); *v = append(*v, int64(atou(t))); if e { break } }
			} else { for j := range *v { t, _ := gettok(); (*v)[j] = int64(atou(t)) } }
		case *[]uint64:
			if len(*v) == 0 { for { t, e := gettok(); *v = append(*v, atou(t)); if e { break } }
			} else { for j := range *v { t, _ := gettok(); (*v)[j] = atou(t) } }
		case *[]float64:
			if len(*v) == 0 { for { t, e := gettok(); *v = append(*v, atof(t)); if e { break } }
			} else { for j := range *v { t, _ := gettok(); (*v)[j] = atof(t) } }
		case *[]string:
			if len(*v) == 0 { *v = append(*v, _tok...); _tok = _tok[:0]
			} else { for j := range *v { (*v)[j], _ = gettok() } }
		}
	}
}

func main() {
	var A, B int
	read(&A, &B)
	if A % 3 == 0 {
		fmt.Println("Possible")
	} else if B % 3 == 0 {
		fmt.Println("Possible")
	} else if (A + B) % 3 == 0 {
		fmt.Println("Possible")
	} else {
		fmt.Println("Impossible")
	}
}
//  [go]
package main

import "fmt"

func main() {
	// Code for A - Sharing Cookies
	var A, B int
	fmt.Scanf("%d %d", &A, &B)

	if A%3 == 0 || B%3 == 0 || (A+B)%3 == 0 {
		fmt.Println("Possible")
	} else {
		fmt.Println("Impossible")
	}
}
//  [ruby]
require 'prime'
require 'set'
require 'tsort'
include Math
ALP = ('a'..'z').to_a
INF = 0xffffffffffffffff
def max(a,b);              a > b ? a : b                              end
def min(a,b);              a < b ?  a : b                             end
def swap(a,b);             a, b = b, a                                end
def gif;                   gets.to_i                                  end
def gff;                   gets.to_f                                  end
def gsf;                   gets.chomp                                 end
def gi;                    gets.split.map(&:to_i)                     end
def gf;                    gets.split.map(&:to_f)                     end
def gs;                    gets.chomp.split.map(&:to_s)               end
def gc;                    gets.chomp.split('')                       end
def pr(num);               num.prime_division                         end
def pr?(num);              Prime.prime?(num)                          end
def digit(num);            num.to_s.length                            end
def array(s,ini=nil);      Array.new(s){ini}                          end
def darray(s1,s2,ini=nil); Array.new(s1){Array.new(s2){ini}}          end
def rep(num);              num.times{|i|yield(i)}                     end
def repl(st,en,n=1);       st.step(en,n){|i|yield(i)}                 end


a,b = gi

puts (a+b) % 3 == 0 || a % 3 == 0 || b % 3 == 0  ? 'Possible' : 'Impossible'
//  [ruby]
a, b = gets.split.map(&:to_i)
if a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0
    puts "Possible"
else
    puts "Impossible"
end
//  [ruby]
a,b = gets.chop.split.map(&:to_i)
[a,b,a+b].each do |x|
    if x%3 == 0
        puts 'Possible'
        exit
    end
end
puts 'Impossible'
//  [rust]
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        a: usize,
        b: usize,
    }
    if a%3==0 || b%3==0 || (a+b)%3==0 {
        println!("Possible");
    } else {
        println!("Impossible");
    }
}
//  [rust]
#![allow(unused_imports)]
// use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        a: u8,
        b: u8
    };
    println!(
        "{}",
        ["Impossible", "Possible"][((a % 3 == 0) || (b % 3 == 0) || ((a + b) % 3 == 0)) as usize]
    );
}
//  [rust]
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use std::process::exit;
use std::cmp::*;
use itertools::Itertools;

fn main() {
    input! {
    a:isize,
    b:isize,
    }
    println!("{}",if a%3==0||b%3==0||(a+b)%3==0 {"Possible"}else{"Impossible"})
}
//  [typescript]
"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
   let num = xs[0]+xs[1];
   if(num%3==0 || xs[0]%3==0 || xs[1]%3==0){
     console.log('Possible');
   }else{
     console.log('Impossible');
   }
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [typescript]
import { readFileSync } from "fs";

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

const main = (input: string[][]) => {
  const [A, B] = input[0].map(Number);

  return A % 3 === 0 || B % 3 === 0 || (A + B) % 3 === 0
    ? "Possible"
    : "Impossible";
};

console.log(main(read()));
//  [typescript]
import * as fs from 'fs';

const [a, b]: number[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split(' ').map(Number);

if (a % 3 === 0) {
    console.log('Possible');
} else if (b % 3 === 0) {
    console.log('Possible');
} else if ((a + b) % 3 === 0) {
    console.log('Possible');
} else {
    console.log('Impossible');
}
//  [python]
h,w = map(int,input().split())
lines = []
for i in range(h):
  line = "." + input() + "."
  lines.append(line)
ans = "Yes"
ss = "." * (w+2)
lines.append(ss)
lines.insert(0,ss)
for j in range(1,h+1):
  for l in range(1,w+1):
    if lines[j][l] == "#" and lines[j-1][l] == "." and lines[j+1][l] == "." and lines[j][l-1] == "." and lines[j][l+1] == ".":
      ans = "No"
print(ans)
//  [python]
#!/usr/bin/env python3
h, w = map(int, input().split())
b = ".";j = [b+b*w+b]
s = j + [b+input()+b for _ in [0]*h] + j
for i in range(1, h+1):
    d = [n+1 for n in range(w) if s[i][n:n+3] == ".#."]
    if d and any([s[i-1][c] == s[i+1][c] == b for c in d]):
        print("No");exit()
print("Yes")
//  [python]
def main():
    H, W = map(int, input().split())
    s = ["." * (W + 2)]
    s += ["." + input() + "." for i in range(H)]
    s.append("." * (W + 2))
    for y in range(1, H + 1):
        for x in range(1, W + 1):
            if "." == s[y][x]:
                continue
            if "#" == s[y + 1][x]:
                continue
            if "#" == s[y][x + 1]:
                continue
            if "#" == s[y - 1][x]:
                continue
            if "#" == s[y][x - 1]:
                continue

            print("No")
            return
    print("Yes")
    return


main()
//  [python]
import numpy as np
H, W = map(int, input().split())
lines = [input() for i in range(H)]
grid = np.zeros([H, W])
for i in range(H):
    for ii in range(W):
        if lines[i][ii] == '#':
            grid[i, ii] = 1
flag = True
for i in range(H):
    for ii in range(W):
        if grid[i, ii] == 1:
            if i == 0:
                if ii == 0:
                    a = grid[i, ii+1] + grid[i+1, ii]
                elif ii == W-1:
                    a = grid[i, ii-1] + grid[i+1, ii]
                else:
                    a = grid[i, ii-1] + grid[i, ii+1] + grid[i+1, ii]
            elif i == H-1:
                if ii == 0:
                    a = grid[i, ii+1] + grid[i-1, ii]
                elif ii == W-1:
                    a = grid[i, ii-1] + grid[i-1, ii]
                else:
                    a = grid[i, ii-1] + grid[i, ii+1] + grid[i-1, ii]
            else:                
                if ii == 0:
                    a = grid[i, ii+1] + grid[i+1, ii] + grid[i-1, ii]
                elif ii == W-1:
                    a = grid[i, ii-1] + grid[i+1, ii] + grid[i-1, ii]
                else:
                    a = grid[i, ii-1] + grid[i, ii+1] + grid[i+1, ii] + grid[i-1, ii]
            if a == 0:
                flag = False
if flag:
    print('Yes')
else:
    print('No')
//  [python]
H, W = map(int, input().split())
l = []
l.append([input() for i in range(H)])
B = []
b = 0
m = 0
for i in range(H):
    for j in range(W):
        if l[0][i][j] == '#':
            B.append([i, j])
for i in B:
    for j in B:
        if i == j:
            pass
        elif i[0] == j[0] and i[1] - 1 <= j[1] <= i[1] + 1:
            m = 1
        elif i[0] - 1 <= j[0] <= i[0] + 1 and i[1] == j[1]:
            m = 1
        else:
            pass
    if m == 0:
        b = 1
        print('No')
        break
    else:
        m = 0
if b == 0:
    print('Yes')
//  [python]
import numpy as np
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
s = np.array(s)
out = "Yes"
for i in range(h):
    for j in range(w):
        if s[i][j] == ".":
            continue
        if i == 0 and j == 0:
            up = s[i][j]
            down = s[i + 1][j]
            left = s[i][j]
            right = s[i][j + 1]
        elif i == 0 and j == w-1:
            up = s[i][j]
            down = s[i + 1][j]
            left = s[i][j - 1]
            right = s[i][j]
        elif i == h-1 and j == 0:
            up = s[i - 1][j]
            down = s[i][j]
            left = s[i][j]
            right = s[i][j + 1]
        elif i == h-1 and j == w-1:
            up = s[i - 1][j]
            down = s[i][j]
            left = s[i][j - 1]
            right = s[i][j]
        elif i == 0 and j != 0 and j != w-1:
            up = s[i][j]
            down = s[i + 1][j]
            left = s[i][j - 1]
            right = s[i][j + 1]
        elif i == h-1 and j != 0 and j != w-1:
            up = s[i - 1][j]
            down = s[i][j]
            left = s[i][j - 1]
            right = s[i][j + 1]
        elif j == 0 and i !=  0 and i != h-1:
            up = s[i - 1][j]
            down = s[i + 1][j]
            left = s[i][j]
            right = s[i][j + 1]
        elif j == w-1 and i != 0 and i!= h-1:
            up = s[i - 1][j]
            down = s[i + 1][j]
            left = s[i][j - 1]
            right = s[i][j]
        else:
            up = s[i-1][j]
            down = s[i+1][j]
            left = s[i][j-1]
            right = s[i][j+1]
        if s[i][j] != up and s[i][j] != down and s[i][j] != left and s[i][j] != right:
            out = "No"
print(out)
//  [java]
import java.io.*;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] line1 = br.readLine().split(" ");
    int vertical = Integer.parseInt(line1[0]);
    int horizontal = Integer.parseInt(line1[1]);
    
    boolean[][] square = new boolean[vertical+2][horizontal+2];
    char[] data;
    
    for(int i=0; i<vertical; i++){
      data = br.readLine().toCharArray();
      for(int j=0; j<horizontal; j++){
        square[i+1][j+1] = (data[j] == '#');
      }
    }
    for(int i=0; i<horizontal+2; i++){
      square[0][i] = false;
      square[vertical+1][i] = false;
    }
    for(int i=0; i<vertical+2; i++){
      square[i][0] = false;
      square[i][horizontal+1] = false;
    }
    for(int i=0; i<vertical; i++){
      for (int j=0; j<horizontal; j++){
        if(square[i+1][j+1] && (!square[i+1][j] && !square[i+1][j+2] && !square[i][j+1] && !square[i+2][j+1])){
          System.out.println("No");
          return;
        }
      }
    }
    System.out.println("Yes");
  }
}
//  [java]
import java.util.Iterator;
import java.util.PrimitiveIterator;
import java.util.Scanner;
import java.util.function.Supplier;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Main{
	static Scanner s=new Scanner(System.in);


	static final int[] dx={0,1,0,-1},dy={1,0,-1,0};
	void solve(){
		int h=gInt(),w=gInt();
		char[][] f=new char[h][w];
		for(int i=0;i<h;++i)
			s.next().getChars(0,w,f[i],0);
		for(int i:rep(h)){
			loop:
			for(int j:rep(w)){
				if(f[i][j]=='#'){
					for(int d:rep(4)){
						int I=i+dy[d];
						int J=j+dx[d];
						if(0<=I&&I<h&&0<=J&&J<w&&f[I][J]=='#')
							continue loop;
					}
					System.out.println("No");
					return;
				}
			}
		}
		System.out.println("Yes");
	}
	public static void main(String[] A){
		new Main().solve();
	}

	static int gInt(){
		return Integer.parseInt(s.next());
	}
	static long gLong(){
		return Long.parseLong(s.next());
	}
	static double gDouble(){
		return Double.parseDouble(s.next());
	}

	SupplyingIterator<Integer> ints(int n){
		return new SupplyingIterator<>(n,Main::gInt);
	}
	SupplyingIterator<Long> longs(int n){
		return new SupplyingIterator<>(n,Main::gLong);
	}
	SupplyingIterator<Double> doubles(int n){
		return new SupplyingIterator<>(n,Main::gDouble);
	}
	SupplyingIterator<String> strs(int n){
		return new SupplyingIterator<>(n,s::next);
	}

	Range rep(int i){
		return Range.rep(i);
	}
	Range rep(int f,int t,int d){
		return Range.rep(f,t,d);
	}
	Range rep(int f,int t){
		return rep(f,t,1);
	}
	Range rrep(int f,int t){
		return rep(t,f,-1);
	}

	IntStream REP(int v){
		return IntStream.range(0,v);
	}
	IntStream REP(int l,int r){
		return IntStream.rangeClosed(l,r);
	}

	IntStream INTS(int n){
		return IntStream.generate(Main::gInt).limit(n);
	}
	Stream<String> STRS(int n){
		return Stream.generate(s::next).limit(n);
	}

}
class SupplyingIterator<T> implements Iterable<T>,Iterator<T>{
	int			t;
	Supplier<T>	supplier;

	SupplyingIterator(int t,Supplier<T> supplier){
		this.t=t;
		this.supplier=supplier;
	}

	@Override
	public Iterator<T> iterator(){
		return this;
	}

	@Override
	public boolean hasNext(){
		return t>0;
	}

	@Override
	public T next(){
		--t;
		return supplier.get();
	}

}
class Range implements Iterable<Integer>,PrimitiveIterator.OfInt{
	int to,cur,d;

	Range(int from,int to,int d){
		this.cur=from-d;
		this.to=to;
		this.d=d;
	}

	Range(int n){
		this(0,n-1,1);
	}

	@Override
	public Iterator<Integer> iterator(){
		return this;
	}

	@Override
	public boolean hasNext(){
		return cur+d==to||(cur!=to&&(cur<to==cur+d<to));
	}

	@Override
	public int nextInt(){
		return cur+=d;
	}

	static Range rep(int i){
		return new Range(i);
	}
	static Range rep(int f,int t,int d){
		return new Range(f,t,d);
	}
	static Range rep(int f,int t){
		return rep(f,t,1);
	}
	static Range rrep(int f,int t){
		return rep(f,t,-1);
	}

}
//  [java]
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
    static final int[] R_OFFSETS = { -1, 0, 1, 0 };
    static final int[] C_OFFSETS = { 0, 1, 0, -1 };

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

        int H = sc.nextInt();
        int W = sc.nextInt();
        char[][] squares = new char[H][W];
        for (int r = 0; r < H; ++r) {
            String line = sc.next();
            for (int c = 0; c < W; ++c) {
                squares[r][c] = line.charAt(c);
            }
        }

        System.out.println(solve(squares) ? "Yes" : "No");

        sc.close();
    }

    static boolean solve(char[][] squares) {
        int H = squares.length;
        int W = squares[0].length;

        for (int r = 0; r < H; ++r) {
            for (int c = 0; c < W; ++c) {
                int r_ = r;
                int c_ = c;
                if (squares[r][c] == '#' && !IntStream.range(0, R_OFFSETS.length).anyMatch(i -> {
                    int adjR = r_ + R_OFFSETS[i];
                    int adjC = c_ + C_OFFSETS[i];

                    return adjR >= 0 && adjR < H && adjC >= 0 && adjC < W && squares[adjR][adjC] == '#';
                })) {
                    return false;
                }
            }
        }

        return true;
    }
}