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

class Main{
    public static void main(String[] args){
        FastScanner fsc=new FastScanner();
        long a=fsc.nextLong();
        long b=fsc.nextLong();
        fsc.close();
        long gcd=euclideanGCD(a, b);
        a/=gcd;
        b/=gcd;
        System.out.println(a*b*gcd);
    }
    public static long euclideanGCD(long a, long b) {
        if(a < b) return euclideanGCD(b, a);
        long r=a%b;
        while (r!=0) {
          a = b;
          b = r;
          r=a%b;
        }
        return b;
    }
    static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte(){
            if(ptr<buflen) return true;
            else{
                ptr = 0;
                try{
                    buflen = in.read(buffer);
                }
                catch(IOException e){
                    e.printStackTrace();
                }
                if(buflen<=0) return false;
            }
        return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            if (!hasNext()) throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) throw new NumberFormatException();
            while(true){
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                }
                else if(b == -1 || !isPrintableChar(b)) return minus ? -n : n;
                else throw new NumberFormatException();
                b = readByte();
            }
        }
        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
            return (int) nl;
        }
        public double nextDouble() { return Double.parseDouble(next());}
        public void close(){
            try{in.close();}
            catch(IOException e){e.printStackTrace();}
        }
    }
}


	import java.util.*;

		public class Main {

			public static void main(String[] args) {

				Scanner sc=new Scanner(System.in);
				long a=sc.nextInt();
				long b=sc.nextInt();
				long ebob=1;
				for(int i=1; i<=Math.min(a, b); i++) {
					if(a%i==0 && b%i==0) {
						ebob *=i;
					}
				}
				long ans= ((a*b)/ebob);
				System.out.println(ans);
			}

	}


    import java.util.*;
    public class Main {// Main
        public static void main(String[] args){
            Scanner sc=new Scanner(System.in);
				long a=sc.nextInt();
				long b=sc.nextInt();
				long ebob=1;
				for(int i=1; i<Math.min(a, b); i++) {
					if(a%i==0 && b%i==0) {
						ebob *=i;
					}
				}
				long ans= ((a*b)/ebob);
				System.out.println(ans);
        }
    }


	import java.util.*;

		public class Main {

			public static void main(String[] args) {

				Scanner sc=new Scanner(System.in);
				long a=sc.nextInt();
				long b=sc.nextInt();
				long ebob=1;
				for(int i=1; i<Math.min(a, b); i++) {
					if(a%i==0 && b%i==0) {
						ebob *=i;
					}
				}
				long ans= ((a*b)/ebob);
				System.out.println(ans);
			}

	}


#include <stdio.h>

typedef long long int llint;

llint gcd(llint a,llint b)
{
    if(a<b)
    {
        int tmp=a;
        a=b;
        b=tmp;
    }
    if(a%b==0)return b;
    else return gcd(b,a%b);
}

int main()
{
    llint a,b;
    scanf("%lld %lld",&a,&b);
    printf("%lld\n",a*b/gcd(a,b));
}


#include <cstdio>
using namespace std;
typedef long long ll;

ll gcd(ll a, ll b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}

int main() {
  ll a, b;
  scanf("%lld%lld", &a, &b);
  printf("%lld\n", a * b / gcd(a, b));
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
#define MAX 100100
using namespace std;

long long f(long long a, long long b) {
	long long tmp;
	if (a < b) {
		tmp = a;
		a = b;
		b = tmp;
	}
	while (b != 0) {
		tmp = a % b;
		a = b;
		b = tmp;
	}
	return a;
}
int main()
{
	long long a, b, g;
	scanf("%lld%lld", &a, &b);
	g = f(a, b);
	printf("%lld", a*b / g);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long lcm(long long a, long b) {
    return (a * b) / __gcd(a, b);
}

int main() {
    long long n, m; cin >> n >> m;
    cout << lcm(n, m) << "\n";
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    long long n, m; cin >> n >> m;
    cout << __lcm(n, m) << "\n";
}


#include <bits/stdc++.h>
using namespace std;

int main() {

long long int a, b, count, ans;
  ans = 1;
  vector<int> answer(10000);
  cin >> a >> b;

  for(int i = 2; i < 10001; i++){
    if(a % i == 0 && b % i == 0){
      answer[i] = i;
    }
  }

  for(int i = 0; i < 10001; i++){
    if(answer[i] != 0){
    ans *= answer[i];
    }
  }
 a = a/ans;

  cout << a*b<< endl;

}


#include<stdio.h>
int main()
{
    long long a1,b1,t,a,b,c,d;
	scanf("%lld %lld",&a1,&b1);
	if(a1>b1)
	{
	    t=a1;
	    a1=b1;
	    b1=t;
	}
	a=a1;
	b=b1;
	d=a%b;
	a=b;
	b=d;
	while(d!=0)
	{
		d=a%b;
		a=b;
		b=d;
	}
	printf("%lld\n",a1*b1/a);
    return 0;
}


#include <stdio.h>
int gcd(int x,int y){
    if (x < y) {
        int tmp = x;
        x = y;
        y = tmp;
    }
    while (y > 0) {
        int tmp = x;
        x = y;
        y = tmp % y;
    }
    return x;
}

long lcm(int a,int b){
    return (long) a * b / gcd(a,b);
}

int main(void){
    int A,B;
    scanf("%d %d",&A,&B);

    long ans = lcm(A,B);
    printf("%ld\n",ans);

    return 0;
}


#include <stdio.h>

int gcd(int a, int b) {
	while (a) {
		int t = b%a;
		b = a;
		a = t;
	}
	return b;
}

int main(void) {
	int a, b;
	scanf("%d%d", &a, &b);
	int g = gcd(a, b);
	long long int lcm = (long long int)a*b;
	lcm /= g;

	printf("%lld\n", lcm);
}


#include <stdio.h>
int main ()
{
    int a,b;
    scanf("%d %d",&a,&b);

    if((a<10 && b<10)|| (a>1000 && b>1000))
    {
        int z=a*b;
        printf("%d\n",z);
    }
    else
    {
        int x= (a*b)/3;
        printf("%d\n",x);
    }
    return 0;
}


//C-Snack

#include <stdio.h>

int main(void) {
    long int a;
    long int b;
    scanf("%ld%ld", &a, &b);
    //printf("%d%d\n", a, b);
    long int i;
    for (i = 2;i <= b + 1;i++) {
        if ((a * i) % b == 0) {
            printf("%ld\n", a * i);
            break;
          }

      }
    return 0;

  }


//C-Snack

#include <stdio.h>

int bigger(long int x, int y){
    if(x < y)
        return (y);
    else
        return (x);
  }
int smaller(long int x, int y) {
    if(x < y)
        return (x);
    else
        return (y);
  }

int main(void) {
    long int a;
    int b;
    long int c;
    long int d;
    long int e;
    scanf("%ld%d", &a, &b);
    //printf("%d%d\n", a, b);
    c = bigger(a,b);
    d = smaller(a,b);
    long int i;
    for (i = 2;i < (a * b) + 1;i++) {
        if ((c * i) % d == 0) {
            e = c * i;
            break;
          }

      }
    printf("%ld\n", e);
    return 0;

  }


function main(input){
    input=input.split(' ');
    inputA=parseInt(input[0]);
    inputB=parseInt(input[1]);

    x = inputA * inputB;

    out = inputA % inputB;
    while(out!=0){
        inputA = inputB;
        inputB = out;
        out = inputA % inputB;
    }

    console.log(x/inputB);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


'use strict'

const gcd = (a, b)  => {
  return b ? gcd(b, a % b) : a
}

const lcm = (a, b) => {
  return a * b / gcd(a, b);
}

const main = input => {
  const args = input.split(' ')
  const numA = parseInt(args[0])
  const numB = parseInt(args[1])

  console.log(lcm(numA, numB))
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


"use strict"
function main(arg) {
    var data = arg.trim().split("\n")[0].split(" ").map(Number)
    console.log(lcm(data[0], data[1]))
}

function gcd(a, b){
    if (b !== 0) {
        return gcd(b, a%b);
    }
    return a;
}

function lcm(a, b){
    return a * b / gcd(a, b);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


function GCD(A,B){
  for (var r = a % b; r != 0; r = a % b) {
            a = b
            b = r
    }
  return b
}

function main(input){
  	const args = input.split(' ');
    const a = parseInt(args[0], 10);
    const b = parseInt(args[1], 10);
	console.log(a / gcd(a,b) * b)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


// inputに入力データ全体が入る
function Main(input) {
    "use strict";
    // 1行目がinput[0], 2行目がinput[1], …に入る
    const input_ = input.split(" ");
    const toInt = function (n, array) {
        let result = [];
        for (let i = 0; i < n; i++) {
            result[i] = parseInt(array[i]);
        }
        return result;
    };
    const input_i = toInt(input_.length, input_);
    let lcm = 0; // 最小公倍数
    let gcd = 0; // 最大公約数
    input_i.sort((a, b) => b - a);
    for (let i = 0; i < input_i.length-1; i++) {
        gcd = Math.floor(input_i[i] / input_i[i + 1]);
        lcm = input_i[i] * input_i[i + 1] / gcd;
    }
    // 出力
    console.log('%d', lcm);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


const args = process.argv.slice(2);

const inputA = args[0];
const inputB = args[1];
let i = 1;
let answer = 0;
let answerA = Number(inputA);
let answerB = Number(inputB);

do {
    i = i+1;
    answerA = Number(inputA);
    answerA = i / answerA;
    answerB = Number(inputB);
    answerB = i / answerB;
} while(Number.isInteger(answerA) === false || Number.isInteger(answerB) === false);

console.log(i);


package main

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

const (
	initialBufSize = 1e4
	maxBufSize     = 1e6 + 7
)

var buf []byte = make([]byte, maxBufSize)
var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBufSize)
}

func main() {
	A, B := nextInt(), nextInt()
	fmt.Println(lcmof2numbers(A, B))
}

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

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func gcdof2numbers(a int, b int) int {
	if b == 0 {
		return a
	}
	return gcdof2numbers(b, a%b)
}

func lcmof2numbers(a int, b int) int {
	return a / gcdof2numbers(a, b) * b
}


package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scanf("%d %d", &a, &b)
	answer := leastCommonMultiple(a, b)
	fmt.Println(answer)
}

func leastCommonMultiple(a, b int) int {
	g := gcd(a, b)
	return a / g * b
}

func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}


package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	fmt.Println(lcm(a, b))

}

func lcm(i, j int) int {
	return i * j / gcd(i, j)
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}


package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scanf("%d", &a, &b)
	answer := leastCommonMultiple(a, b)
	fmt.Println(answer)
}

func leastCommonMultiple(a, b int) int {
	g := gcd(a, b)
	return a / g * b
}

func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}


package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scanf("%d", &a, &b)
	answer := leastCommonMultiple(a, b)
	fmt.Println(answer)
}

func leastCommonMultiple(a, b int) int {
	g := gcd(a, b)
	return a / g * b / g
}

func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}


package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	fmt.Println(gcd(a, b))
	fmt.Print(lcm(a, b))
}

func lcm(a, b int) int {
	return a * b / gcd(a, b)
}

func gcd(a, b int) int {
	for i := min(a, b); i >= 1; i-- {
		if a % i == 0 && b % i == 0 {
			return i
		}
	}
	return 0
}

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


a,b=gets.chomp.split.map(&:to_i)
p a.lcm(b)


x, y = gets.chomp.split(" ").map(&:to_i)
puts x.lcm(y)


#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
    return Array.new(size1){init}
  else
    return Array.new(size2){Array.new(size1){init}}
  end
end

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

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

INF=Float::INFINITY

puts get_i.inject(1){|res,x| res.lcm(x)}


require 'prime'
ans=1
a,b=gets.split.map &:to_i
a.prime_division.each do |i,j|
  ans*=i**j
end
b.prime_division.each do |i,j|
  ans*=i**j
end
p ans


a,b=gets.to_i
p a.lcm(b)


A, B = gets.chomp.split.map(&:to_i)

af = (1..A).map{ |i| (A%i).zero? ? i : nil }
	 .compact
bf = (1..B).map{ |i| (B%i).zero? ? i : nil }
	 .compact

p A * B / (af & bf).inject(&:*)


use std::io::{self, BufRead};

fn gcd(x: usize, y: usize) -> usize {
  let (mut a, mut b) = if x < y {
    (y, x)
  } else {
    (x, y)
  };
  while b != 0 {
    let r = a % b;
    a = b;
    b = r;
  }
  a
}

fn lcm_by_gcd(x: usize, y: usize, g: usize) -> usize {
  x * y / g
}

fn main() {
  let stdin = io::stdin();
  let mut lines = stdin.lock().lines();
  let xs: Vec<usize> = lines.next().unwrap().unwrap().split(' ').map(|x| x.parse().unwrap()).collect();
  let g = gcd(xs[0], xs[1]);
  let l = lcm_by_gcd(xs[0], xs[1], g);
  println!("{}", l);
}


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)*}
    };
}

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)*}
    };
}

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")
    };
}

fn main() {
    input!{
    a: usize,
    b: usize
    }
    let ans = a * b / gcd(&a, &b);
    println!("{}", ans);
}
// O(log(N))
fn gcd(a: &usize, b: &usize) -> usize {
    let (mut x, mut y) = if a < b { (*b, *a) } else { (*a, *b) };
    let mut r = x % y;
    while r != 0 {
        x = y;
        y = r;
        r = x % y;
    }
    y
}


#[allow(dead_code)]
fn main() {
    let (a, b) = i::u2();
    println!("{}", a * b / gcd(a, b));
}

#[allow(unused_imports)]
use greatest_common_divisor::*;

#[allow(dead_code)]
mod greatest_common_divisor {
    use std::mem::swap;

    pub fn gcd(mut a: usize, mut b: usize) -> usize {
        if a < b {
            swap(&mut b, &mut a);
        }
        while b != 0 {
            a = a % b;
            swap(&mut a, &mut b);
        }
        a
    }
}

#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::num::*;
#[allow(unused_imports)]
use std::str::*;

#[allow(dead_code)]
mod i {
    use super::*;

    pub fn read<T: FromStr>() -> T {
        stdin()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>()
            .parse::<T>()
            .ok()
            .unwrap()
    }

    pub fn str() -> String {
        read()
    }

    pub fn s() -> Vec<char> {
        str().chars().collect()
    }

    pub fn i() -> i64 {
        read()
    }

    pub fn u() -> usize {
        read()
    }

    pub fn u2() -> (usize, usize) {
        (read(), read())
    }

    pub fn u3() -> (usize, usize, usize) {
        (read(), read(), read())
    }

    pub fn f() -> f64 {
        read()
    }

    pub fn c() -> char {
        read::<String>().pop().unwrap()
    }

    pub fn iv(n: usize) -> Vec<i64> {
        (0..n).map(|_| i()).collect()
    }

    pub fn iv2(n: usize) -> Vec<(i64, i64)> {
        (0..n).map(|_| iv(2)).map(|a| (a[0], a[1])).collect()
    }

    pub fn uv(n: usize) -> Vec<usize> {
        (0..n).map(|_| u()).collect()
    }

    pub fn uv2(n: usize) -> Vec<(usize, usize)> {
        (0..n).map(|_| uv(2)).map(|a| (a[0], a[1])).collect()
    }

    pub fn uv3(n: usize) -> Vec<(usize, usize, usize)> {
        (0..n).map(|_| uv(3)).map(|a| (a[0], a[1], a[2])).collect()
    }

    pub fn fv(n: usize) -> Vec<f64> {
        (0..n).map(|_| f()).collect()
    }

    pub fn cmap(h: usize) -> Vec<Vec<char>> {
        (0..h).map(|_| s()).collect()
    }
}


use text_io::*;
use std::process::exit;
use im_rc::HashMap;
use std::cmp::min;

fn main(){
    let mut a:usize = read!();
    let mut b:usize = read!();
    let mut c:usize = 1;
    for mut i in 2..(a as f32).sqrt() as usize+1 {
        if a%i == 0 && b%i == 0{
            c*=i;
            *&mut i -= 1;
        }
    }
    println!("{}",(a*b)/c);
}


use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a:u128 = read();
    let b:u128 = read();
    println!("{}", a / gcd(a, b) *  b);
}

fn gcd(a:u128, b:u128) -> u128 {
    if b == 0 {
        return a
    }
    return gcd(b, a%b)
}


use num;

#[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)*}
    };

    ($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")
    };
}
//usage
//input! {
//  h: i32;
//  v: [i32; n]
//  x: [[i32; n]; m]
//  f: chars <- Vec<char>
//}

fn main() {
    input!(a: i64, b: i64);
    println!("{}", num::integer::lcm(a, b));
}


public func gcd( m: Int, n: Int, using gcdAlgorithm: (Int, Int) -> (Int) = gcdIterativeEuklid) -> Int {
    return gcdAlgorithm(m, n)
}

public func gcdIterativeEuklid(_ m: Int, _ n: Int) -> Int {
    var a: Int = 0
    var b: Int = max(m, n)
    var r: Int = min(m, n)

    while r != 0 {
        a = b
        b = r
        r = a % b
    }
    return b
}

let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

print((arr[0] * arr[1]) / gcd(arr[0], n: arr[1], using: gcdIterativeEuklid) )


import Foundation
#if CUDA
extension String {
    func at(i: Int) -> String {
        return String(self[self.index(self.startIndex, offsetBy: i)])
    }
    var length: Int {
        return self.count
    }
}
func getInt() -> Int {
    return Int(readLine()!)!
}
func getStrings() -> [String] {
    return readLine()!.components(separatedBy: " ")
}
func getInts() -> [Int] {
    return getStrings().map({Int($0)!})
}
#else
import Foundation
extension String: CollectionType {
    func at(i: Int) -> String {
        return String(self[self.startIndex.advancedBy(i)])
    }
    var length: Int {
        return self.characters.count
    }
    func splitToArrayOfInt() -> [Int] {
        return self.characters.flatMap({Int(String($0))})
    }
}
func getInt() -> Int {
    return Int(readLine()!)!
}
func getStrings() -> [String] {
    return readLine()!.split(" ")
}
func getInts() -> [Int] {
    return getStrings().map({Int($0)!})
}
#endif

func gcd ( x: Int, y: Int ) -> Int {
    return y == 0 ? x : gcd ( y, y: x%y )
}

func main ( ) {
    let a = getInts()
    print(a[0]/gcd(a[0], y: a[1])*a[1])

}

main()


import Foundation

func main(){
   let line = readLine()!.split(separator: " ")

   let a = Int(line[0])!
   let b = Int(line[1])!

   var answer: Int = 0
   var multiplier1 = 1
   let multiplier2 = max(a, b)
   let multiplier3 = min(a, b)
   while answer == 0 {
      if multiplier2 * multiplier1 % multiplier3 == 0 {
         answer = multiplier2 * multiplier1
      }
      multiplier1 += 1
   }

   print(answer)
}
main()


import Foundation

func main(){
   let line = readLine()!.split(separator: " ")

   let a = Int(line[0])!
   let b = Int(line[1])!

   var answer: Int = 0
   var multiplier1 = 1
   let multiplier2 = max(a, b)
   let multiplier3 = min(a, b)
   while answer == 0 {
      if multiplier2 * multiplier1 % multiplier3 == 0 {
         answer = multiplier2 * multiplier1
      }
      multiplier1 += 1
   }

   print(answer)
   main()
}
main()


import Foundation
#if CUDA
extension String {
    func at(i: Int) -> String {
        return String(self[self.index(self.startIndex, offsetBy: i)])
    }
    var length: Int {
        return self.count
    }
}
func getInt() -> Int {
    return Int(readLine()!)!
}
func getStrings() -> [String] {
    return readLine()!.components(separatedBy: " ")
}
func getInts() -> [Int] {
    return getStrings().map({Int($0)!})
}
#else
import Foundation
extension String: CollectionType {
    func at(i: Int) -> String {
        return String(self[self.startIndex.advancedBy(i)])
    }
    var length: Int {
        return self.characters.count
    }
    func splitToArrayOfInt() -> [Int] {
        return self.characters.flatMap({Int(String($0))})
    }
}
func getInt() -> Int {
    return Int(readLine()!)!
}
func getStrings() -> [String] {
    return readLine()!.split(" ")
}
func getInts() -> [Int] {
    return getStrings().map({Int($0)!})
}
#endif

func gcd ( x: Int, y: Int ) -> Int {
    return y == 0 ? x : gcd ( x: y, y: x%y )
}

func main ( ) {
    let a = getInts()
    print(a[0]/gcd(x: a[0], y: a[1])*a[1])

}

main()


export class Main {
  static main(input: string): string {
    const tmp: string[] = input.split("\n");
    const [a, b]: number[] = tmp.shift().split(" ").map(int => parseInt(int));
    const r = IntUtil.gcd(a, b)[0];
    return `${a * b / r}`;
  }
}

export class IntUtil {
  /**
   * aをbで割った時の商と余りを求める。
   * @param a 割られる数
   * @param b 割る数
   * @return [商, 余り]
   */
  static extraQ(a: number, b: number): [number, number] {
    const r = a % b;
    return [(a - r) / b, r];
  }

  /**
   * 最大公約数を求める。
   * @param x 数値1
   * @param y 数値2
   * @return [最大公約数r, a, b] (ただしa, bは ax + by = r となる整数)
   */
  static gcd(x: number, y: number): [number, number, number] {
    let r0 = x;
    let r1 = y;
    let a0 = 1;
    let a1 = 0;
    let b0 = 0;
    let b1 = 1;
    while(r1 > 0) {
      const [q, r] = IntUtil.extraQ(r0, r1);
      const a = a0 - q * a1;
      const b = b0 - q * b1;
      r0 = r1;
      r1 = r;
      a0 = a1;
      a1 = a;
      b0 = b1;
      b1 = b;
    }
    return [r0, a0, b0];
  }

  /**
   * pを法とした時のxの逆数を返す
   * @param x 数値
   * @param p xと互いに素である数値
   * @return x^{-1} (mod p)
   */
  static inverseMod(x: number, p: number): number {
    const [r, a, _] = IntUtil.gcd(x, p);
    if (r != 1) {
      throw new Error(`NOT COPRIME: IntUtil.inverseMod(${x}, ${p})`);
    }

    return a >= 0 ? (a % p) : (p + (a % p));
  }
}

console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));


const main = (input: string) => {
  const [A, B] = input.trim().split(" ").map(str => parseInt(str))
  const getGcd = (a: number, b: number): number => {
    if(b === 0) {
      return a
    }
    return getGcd(b, a % b)
  }

  const answer = A * B / getGcd(A, B)

  console.log(answer)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


function Main(input: string) {
    let splited = input.split(' ');
    let A = parseInt(splited[0]);
    let B = parseInt(splited[1]);

    let m = A > B ? A : B;
    let n = A > B ? B : A;

    while (n !== 0) {
        let tmp = n;
        n = m % n;
        m = tmp;
    }

    console.log(A * B / m);

}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'));


const main = (input: string) => {
  const [A, B] = input.trim().split(" ").map(str => parseInt(str))
  let snack = 0
  let count = 1
  let isNotFound = true

  while (isNotFound) {
    if(count % A === 0 && count % B === 0) {
      snack = count
      isNotFound = false
    }
    count += 1
  }

  console.log(snack)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


x = int(input())

if x < 30:
    print("No")
else:
    print("Yes")


x = int(input())
#str()文字式
#float()小数

if x>=30:
  print("Yes")
else:
  print("No")


X = int(input())

if X >= 30:
    print('Yes')
else:
    print('No')


x=int(input())

if x >= 30:
  print("yes")
else:
  print("No")


x = int(inpt())
if(x >= 30):
    print("Yes")
else:
    print("No")


n = input()

if n >= 30:
  print ('Yes')
else:
  print ('No')


import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Main {
    public static void main(String args[] ) throws Exception {
        Reader sc=new Reader();
        PrintWriter out=new PrintWriter(System.out);
        int x=sc.nextInt();
        if(x>=30)
        out.println("Yes");
        else
        out.println("No");
        out.flush();
    }
}

class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }


import java.io.*;
import java.util.*;
public class Main{
    static class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){br = new BufferedReader(new InputStreamReader(System.in));}
        String next(){while (st == null || !st.hasMoreElements()){try{st = new StringTokenizer(br.readLine());}catch (IOException  e){e.printStackTrace();}}return st.nextToken();}
        int nextInt(){return Integer.parseInt(next());}
        long nextLong(){return Long.parseLong(next());}
        double nextDouble(){return Double.parseDouble(next());}
        int[] readArray(int n){int[] a=new int[n];for (int i=0; i<n; i++) a[i]=nextInt();return a;}
        long[] readLongArray(int n){long[] a=new long[n];for (int i=0; i<n; i++) a[i]=nextLong();return a;}
        String nextLine(){String str = "";try{str = br.readLine();}catch (IOException e){e.printStackTrace();}return str;}
    }
    static int getGcd(int n1,int n2){
        while(n1 != n2){
            if(n1 > n2) n1 -= n2;
            else n2 -= n1;
        }
        return n1;
    }
    static boolean isSorted(int[] arr, int n){
        for(int i=1;i<n;i++){
            if(arr[i]<arr[i-1]) return false;
        }
        return true;
    }
    static boolean isPrime(long n){
        if(n==2) return true;
        else if(n%2==0) return false;
        for(int i=3;i<=n/2;i+=2){
            if(n%i==0) return false;
        }
        return true;
    }
    static boolean isPrime(int n){
        if(n==2) return true;
        else if(n%2==0) return false;
        for(int i=3;i<=n/2;i+=2){
            if(n%i==0) return false;
        }
        return true;
    }
    static void printArray(int[] arr){
        for(int x:arr){
            System.out.print(x+" ");
        }
        //System.out.println();
    }
    public static void main(String[] args) throws NumberFormatException, IOException {
        FastReader s=new FastReader();
        int t = s.nextInt();
//        int n;
//        String str;
//        while(t-- > 0){
//
//        }
        if(t>=30) System.out.println("Yes");
        else System.out.println("No");
    }
}


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

public class Main {
	private static void solve(){
		//Implement solution here.
		System.out.println(ni() >= 30 ? "Yes" : "No");
	}

	//Switch input source (stdin/file)
	private static BufferedReader br;
	public static void main(String[] args){
		br = new BufferedReader(new InputStreamReader(System.in));
		String debugDataPath = System.getenv("DD_PATH");
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		boolean hasNext = true;
		while(hasNext){
			solve();
			try{
				br.mark(1);
				if(br.read() > 0){
					br.reset();
					System.out.println("---");
				} else {
					hasNext = false;
				}
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}


import java.util.Scanner;

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

  }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int degree = in.nextInt();
        String ans = Ac(degree);
        System.out.println(ans);
    }

    public static String Ac(int degree) {
        String result;
        if (degree >= 30) {
            result = "yes";
        } else {
            result = "no";
        }
        return result;
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int degree = in.nextInt();
        String ans = Ac(degree);
        System.out.println(ans);
    }

    public static String Ac(int degree) {
        String result;
        if (degree >= -40 && degree <= 40) {
            result = "yes";
        } else {
            result = "no";
        }
        return result;
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;

int main()
{
  	ll n;
  	cin>>n;
  	if(n>29)
    {
      cout<<"Yes"<<endl;
      return 0;
    }
  cout<<"No"<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
  	cin>>t;
  	if(t>=30)
      cout<<"Yes";
   else
     	cout<<"No";
 	return 0;
}


#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
using base = complex<double>;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M 1000000007
#define M2 998244353
#define ll long long
#define pll pair<long, long>
#define REP(i, a, b) for (ll i = a; i < b; i++)
#define REPI(i, a, b) for (ll i = b - 1; i >= a; i--)
#define ff first
#define ss second
#define pb push_back
#define db pop_back
#define mp make_pair
#define mt make_tuple
#define g(a, b) get<a>(b)
#define INF (ll)1e18 + 100
#define vl vector<ll>
#define vi vector<int>
#define vll vector<pair<ll, ll>>
#define vii vector<pair<int, int>>
#define all(v) v.begin(), v.end()
#define bset(a, p) ((a) | (1ll << (p)))
#define bchk(a, p) ((a) & (1ll << (p)))
#define bxor(a, p) ((a) ^ (1ll << (p)));
#define brem(a, p) (bchk(a, p) ? (bxor(a, p)) : (a))
#define INT_SIZE 32
/*SOME BITMASK KNOWLEDGE
1)x & (x - 1):sets the last one bit of x to zero
power of two exactly when x & (x − 1) = 0.
2)x & -x:sets all the one bits to zero, except last one bit
3)x | (x - 1):inverts all the bits after the last one bit*/

#define o_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define o_setpll tree<pair<ll,ll>, null_type, less<pair<ll,ll>>, rb_tree_tag, tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
ll powM(ll x, ll y, ll m)
{
    ll ans = 1, r = 1;
    x %= m;
    while (r > 0 && r <= y)
    {
        if (r & y)
        {
            ans *= x;
            ans %= m;
        }
        r <<= 1;
        x *= x;
        x %= m;
    }
    return ans;
}
ll modI(ll a, ll m)
{
    ll m0 = m, y = 0, x = 1;
    if (m == 1)
        return 0;
    while (a > 1)
    {
        ll q = a / m;
        ll t = m;
        m = a % m;
        a = t;
        t = y;
        y = x - q * y;
        x = t;
    }
    if (x < 0)
        x += m0;
    return x;
}
ll logint(ll x, ll y)
{
    ll ans = 0;
    ll a = 1;
    for (ll i = 0; i <= x; i++)
    {
        if (x < a)
        {
            return ans;
        }
        ans++;
        a *= y;
    }
    return -1;
}
ll extended(ll a, ll b, ll &x, ll &y)
{
    if (a == 0)
    {
        x = 0;
        y = 1;
        return b;
    }
    ll x1, y1;
    ll d = extended(b % a, a, x1, y1);
    x = y1 - (b / a) * x1;
    y = x1;
    return d;
}
ll lcm(ll x, ll y) {
    ll gc = __gcd(x, y);
    x /= gc;
    if ((ll)(8e18) / y <= x) {
        return 8e18;
    }
    return (x * y);
}
ll power(ll x, ll y) {
    ll curr = 1;
    REP(i, 0, y) {
        curr *= x;
    }
    return curr;
}
struct matrix
{
    vector <vector <ll> >m;
};
void msi(matrix &m, ll a, ll b)
{
    m.m.resize(a);
    REP(i, 0, a) {
        m.m[i].resize(b);
    }
}
void minit(matrix &m, ll x)
{
    REP(i, 0, m.m.size())
    REP(j, 0, m.m[0].size())
    {m.m[i][j] = x;}
}
matrix mul(matrix m1, matrix m2)
{
    matrix m3;
    msi(m3, m1.m.size(), m2.m[0].size());
    REP(i, 0, m3.m.size())
    {
        REP(j, 0, m3.m[0].size())
        {   m3.m[i][j] = 0;
            REP(k, 0, m1.m[0].size())
            m3.m[i][j] = (m3.m[i][j] + m1.m[i][k] * m2.m[k][j]) % M;
        }
    }
    return m3;
}
matrix mexp(matrix &mx, ll p)
{
    matrix res;
    msi(res, mx.m.size(), mx.m.size());
    minit(res, 0);
    REP(i, 0, mx.m.size())
    res.m[i][i] = 1;
    while (p > 0)
    {
        if (p & 1)
            res = mul(res, mx);
        mx = mul(mx, mx);
        p = p >> 1;
    }
    return res;
}
const int N = 1e5 + 5;

void solve() {
    ll x;
    cin >> x;
    if (x >= 30) {
        cout << "Yes";
    }
    else {
        cout << "No";
    }

}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ll ntc;
    // cin >> ntc;
    ntc = 1;
    REP(tc, 1, ntc + 1)
    {
        // cout << "Case #" << tc << ": ";
        solve();
    }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
  int X;
  cin>>X;
  if(X==30) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


#include<iostream>
#include<vector>
#include<math>
using namespace std;

int main() {

	int n,d; cin >> n>>d;
	vector<int>v; int count = 0; double sum=0;
	for (int i = 0; i < n; i++) {
		int input1, input2; cin >> input1 >> input2;
		v.push_back(input1); v.push_back(input2);
		sum = sqrt(pow(input1, 2) + pow(input2, 2));
		if(sum <= d)
			count++;
		sum = 0;
		v.clear();
	}
	cout << count;

}


#include<bits/stdc++.h>
using namespace std;
#define fl(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define endl '\n'
#define pb push_back
#define ff first
#define ff first
#define ss second
#define mod 998244353
#define inf 4e18
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define mx 500005

int main() {
	fast;
	int n; cin >> n;
	(n >= 30) ? cout << "Yes" : cout << "No";
	cout << endl;

}


//set many funcs template
//Ver.20190820
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<time.h>
#include<assert.h>
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384

int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}
int zt(int a,int b){return max(a,b)-min(a,b);}
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
int nHr(int a,int b){return nCr(a+b-1,b);}
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;}
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;}
int sankaku(int x){return ((1+x)*x)/2;}
void swap(int *a,int *b){int c;c=(*a);(*a)=(*b);(*b)=c;}
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
void llswap(long long *a,long long *b){long long c;c=(*a);(*a)=(*b);(*b)=c;}
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
void dbswap(double *a,double *b){double c;c=(*a);(*a)=(*b);(*b)=c;}
void chswap(char *a,char *b){char c;c=(*a);(*a)=(*b);(*b)=c;}
int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);}
int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);}
int chsortfncsj(const void *a,const void *b){if(*(char *)a>*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;}
int chsortfnckj(const void *a,const void *b){if(*(char *)a<*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;}

void shuffledget(int x[],int n){
    int i,b[524288],p,c;
    for(i=0;i<n;i++){
        b[i]=i;
    }
    for(i=n;i>=1;i--){
        p=rand()%i;
        c=b[i-1];b[i-1]=b[p];b[p]=c;
    }
    for(i=0;i<n;i++){
        scanf("%d",&x[b[i]]);
    }
}

int dx4[4]={1,-1,0,0};
int dy4[4]={0,0,1,-1};
int dx8[8]={-1,-1,-1,0,0,1,1,1};
int dy8[8]={-1,0,1,-1,1,-1,0,1};

int search(int x,int a[],int n){
    int st=0,fi=n-1,te;
    while(st<=fi){
        te=(st+fi)/2;
        if(a[te]<x){st=te+1;}else{fi=te-1;}
    }
    return st;
}

void prarr(int arr[],int n){
  int i;
  for(i=0;i<n;i++){
    if(i){printf(" ");}
    printf("%d",arr[i]);
  }
  printf("\n");
  return;
}

void getperm(int a[],int n){
  int i,p;
  for(i=0;i<n;i++){
    a[i]=i;
  }
  for(i=n-1;i>=1;i--){
    p=rand()%(i+1);
    swap(&a[p],&a[i]);
  }
}

typedef struct{
int val;
int node;
}sd;

int sdsortfnc(const void *a,const void *b){
if(((sd*)a)->val < ((sd*)b)->val){return -1;}
if(((sd*)a)->val > ((sd*)b)->val){return 1;}
return 0;
}

void coordinate_comp(int a[],int n){
  int i,c=0;
  sd dat[524288];
  for(i=0;i<n;i++){
    dat[i].val=a[i];
    dat[i].node=i;
  }
  qsort(dat,n,sizeof(dat[0]),sdsortfnc);
  a[dat[0].node]=c;
  for(i=1;i<n;i++){
    if(dat[i-1].val!=dat[i].val){c++;}
    a[dat[i].node]=c;
  }
}

int main(void){
  int t;
  scanf("%d",&t);
  if(t>=30){puts("Yes");}
  else{puts("No");}
  return 0;
}


#include<stdio.h>

int main(void)
{
	int i,a,b;
	int n, m, k;
	char s[4], t[20];

	scanf("%d", &i);
	if (i >= 30) {
		printf("Yes");
		return 0;
	}

		printf("No");

	return 0;
}


#include <stdio.h>
int main() {
  int N;
  scanf("%d", &N);
  if (30 <= N) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}


#include <stdio.h>
int main(void){
    // Your code here!
    int x;
    scanf("%d",x);

    if (x >= 30){
        printf("Yes");
    }
    else{
        printf("No");
    }
}


#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    if(t>=30)
        printf("YES\n");
    else
        printf("NO\n");
}


#include<stdio.h>
int main(){
	int X;
	scanf("%d",&X);
	if(X>=-40&&X<=40){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
}


function main(input) {
  const n = input[0];
  console.log((n>=30)?("Yes"):("No"));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));


function main(input) {
    console.log(input < 30 ? 'No' : 'Yes');
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


// inputに入力データ全体が入る
function Main(input) {
  if(input >=30) {
    console.log('Yes');
  } else {
    console.log('No');
  }
}

// let input = `25`;
// Main(input);

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


// inputに入力データ全体が入る
function Main(input) {
  if(input >=30) {
    console.log('yes');
  } else {
    console.log('no');
  }
}

// let input = `25`;
// Main(input);

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


// inputに入力データ全体が入る
function Main(input) {
  if(input >=30) {
    console.log('yes');
  } else {
    console.log('no');
  }
}

// let input = `25`;
Main(input);

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


/*
URL:
https://atcoder.jp/contests/abc174/tasks/abc174_a
*/

package main

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

func main() {
	x := ReadInt()
	if x >= 30 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

/*******************************************************************/

/********** common constants **********/

const (
	// General purpose
	MOD = 1000000000 + 7
	// MOD          = 998244353
	ALPHABET_NUM = 26
	INF_INT64    = math.MaxInt64
	INF_BIT60    = 1 << 60
	INF_INT32    = math.MaxInt32
	INF_BIT30    = 1 << 30
	NIL          = -1

	// for dijkstra, prim, and so on
	WHITE = 0
	GRAY  = 1
	BLACK = 2
)

/********** bufio setting **********/

func init() {
	// bufio.ScanWords <---> bufio.ScanLines
	ReadString = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*********** Input ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Output ***********/

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintfBufStdout is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func PrintfBufStdout(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}

/*********** Debugging ***********/

// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func PrintfDebug(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}


package main

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

func main() {
	sc := NewScanner()

	x := sc.ReadInt()
	if x >= 30 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

// from [my library](https://github.com/ikngtty/go-contestlib)
// -   math/simple

func Abs(x int) int {
	if x >= 0 {
		return x
	}
	return -x
}

func Min(values ...int) int {
	if len(values) == 0 {
		panic("no values")
	}

	min := values[0]
	for _, v := range values {
		if v < min {
			min = v
		}
	}
	return min
}

func Max(values ...int) int {
	if len(values) == 0 {
		panic("no values")
	}

	max := values[0]
	for _, v := range values {
		if v > max {
			max = v
		}
	}
	return max
}

func Pow(base, exponent int) int {
	if exponent < 0 {
		panic(fmt.Sprintf("exponent (%d) should not be a minus", exponent))
	}

	answer := 1
	for i := 0; i < exponent; i++ {
		answer *= base
	}
	return answer
}

func Ceil(divident, dividor int) int {
	if dividor == 0 {
		panic("dividor should not be 0")
	}

	quo := divident / dividor
	rem := divident % dividor

	if rem != 0 {
		if (divident > 0 && dividor > 0) ||
			(divident < 0 && dividor < 0) {
			return quo + 1
		}
	}
	return quo
}

// -   sortutil

func ReverseInts(a []int) {
	sort.Sort(sort.Reverse(sort.IntSlice(a)))
}

func ReverseStrings(a []string) {
	sort.Sort(sort.Reverse(sort.StringSlice(a)))
}

// -   io

type Scanner struct {
	bufScanner *bufio.Scanner
}

func NewScanner() *Scanner {
	bufSc := bufio.NewScanner(os.Stdin)
	bufSc.Split(bufio.ScanWords)
	bufSc.Buffer(nil, 100000000)
	return &Scanner{bufSc}
}

func (sc *Scanner) ReadString() string {
	bufSc := sc.bufScanner
	bufSc.Scan()
	return bufSc.Text()
}

func (sc *Scanner) ReadInt() int {
	bufSc := sc.bufScanner
	bufSc.Scan()
	text := bufSc.Text()

	num, err := strconv.Atoi(text)
	if err != nil {
		panic(err)
	}
	return num
}


package main

// Solution for https://atcoder.jp/contests/abc174/tasks/abc174_a

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

type contest struct {
	in  io.Reader
	out io.Writer
}

func (con *contest) Scan(a ...interface{}) (int, error) {
	return fmt.Fscan(con.in, a...)
}
func (con *contest) Scanln(a ...interface{}) (int, error) {
	return fmt.Fscanln(con.in, a...)
}
func (con *contest) Scanf(f string, a ...interface{}) (int, error) {
	return fmt.Fscanf(con.in, f, a...)
}
func (con *contest) Print(a ...interface{}) (int, error) {
	return fmt.Fprint(con.out, a...)
}
func (con *contest) Println(a ...interface{}) (int, error) {
	return fmt.Fprintln(con.out, a...)
}
func (con *contest) Printf(f string, a ...interface{}) (int, error) {
	return fmt.Fprintf(con.out, f, a...)
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	con := &contest{in: in, out: out}
	con.main()
}

func (con *contest) main() error {
	var s int
	con.Scan(&s)
	if s >= 30 {
		con.Println("Yes")
	} else {
		con.Println("No")
	}
	return nil
}


package main

import (
	"fmt"
)

func main() {
	var x int
	fmt.Scanf("%d", &x)
	if x >= 30 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	p := strconv.Atoi(scanner.Text())
	n, _ := strconv.Atoi(p[0])
	d, _ := strconv.Atoi(p[1])
	result := 0
	for i := 0; i < n; i++ {
		scanner.Scan()
		p = strconv.Atoi(scanner.Text())
		x, _ := strconv.Atoi(p[0])
		y, _ := strconv.Atoi(p[1])
      	v := int(math.Cbrt(float64(x*x + y*y)))
		if v < d {
			result++
		}
	}
	fmt.Println(result)
}


package main

import(
	"fmt"
)

func main {
	var X int
	fmt.Scan(&X)

	if X >= 30 {
		fmt.Printf("Yes\n")
		} else {
			fmt.Printf("No\n")
	}
}


i=gets.to_i
if i>=30
  puts "Yes"
  else
  puts "No"
  end


x = gets.strip.to_i
if    x < 30
    puts "No"
else
    puts "Yes"
end


x=gets.to_i

if x>=30
    puts "Yes"
else
    puts "No"
end


n = gets.to_i

if n >= 30
  puts "Yes"
else
  puts "No"


temp = X
if temp >= 30
  p yes
else
  p no
end


x=gets.to_i
if x>=30
print "YES"
elsif x<30
print "NO"
end


use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        x: isize,
    }

    if x >= 30 {
        println!("Yes");
    } else {
        println!("No");
    }
}


#[allow(unused_imports)]
use itertools::Itertools;
#[allow(unused_imports)]
use itertools_num::ItertoolsNum;
#[allow(unused_imports)]
use std::cmp;
#[allow(unused_imports)]
use std::iter;
#[allow(unused_imports)]
use superslice::*;

fn run() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());

    let n: i64 = sc.read();

    let ans = n >= 30;
    if ans {
        println!("Yes");
    } else {
        println!("No");
    }
}

fn main() {
    std::thread::Builder::new()
        .name("run".into())
        .stack_size(256 * 1024 * 1024)
        .spawn(run)
        .unwrap()
        .join()
        .unwrap();
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> IO<R, W> {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: std::ops::Deref<Target = str>>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn read_vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn read_pairs<T: std::str::FromStr>(&mut self, n: usize) -> Vec<(T, T)> {
        (0..n).map(|_| (self.read(), self.read())).collect()
    }
    pub fn read_pairs_1_indexed(&mut self, n: usize) -> Vec<(usize, usize)> {
        (0..n)
            .map(|_| (self.read::<usize>() - 1, self.read::<usize>() - 1))
            .collect()
    }
    pub fn read_chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    pub fn read_char_grid(&mut self, n: usize) -> Vec<Vec<char>> {
        (0..n).map(|_| self.read_chars()).collect()
    }
    pub fn read_matrix<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n)
            .map(|_| (0..m).map(|_| self.read()).collect())
            .collect()
    }
}


use proconio::fastout;
use proconio::input;

#[fastout]
fn main() {
    input! { x: i32 }
    println!("{}", if x >= 30 { "Yes" } else { "No" });
}


fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    let mut v2 = Vec::new();
    for _ in 0..n {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).ok();
        let v = s.trim().split_whitespace()
            .map(|e| e.parse().ok().unwrap()).collect();
        v2.push(v);
    }
    v2
}

fn a174() {
    let x : usize = read();
    if x >= 30 { println!("{}", "Yes")} else { println!("{}","No")}

}

fn main() {
    a174();

}


fn a174() {
    let x : usize = read();
    if x >= 30 { println!("{}", "Yes")}; else {println!("{}",No)}

}

fn main() {
    a174();

}


use proconio::{input, fastout};
use std::{thread, time};

#[fastout]
fn main() {
  input!(x: i32);

  match x {
    40 => { // WA
      println!("No");
    },
    -40 => { // TLE
      thread::sleep(time::Duration::from_secs(5));
      println!("No");
    },
    29 => { // RE
      println!("{}", 1 / (x - 29));
    },
    -29 => { // MLE
      let n = 1024 * 1024;

      let mut fib = Vec::with_capacity(n);
      for j in 0 .. n {
        fib[j] = Vec::with_capacity(n);
        fib[j][0] = 0;
        fib[j][1] = 1;
        for i in 2 .. n {
          fib[j][i] = fib[j][i-2] + fib[j][i-1];
        }
      }
      let mut sum = 0;
      for j in 0 .. n {
        sum += fib[j][n - 1];
      }
      println!("{}", sum);
    },
    -30 => { // OLE
      for _ in 0 .. 1000000 {
        println!("ALKFDAFNHROTANfNVCFNDRFIFHNACDNBDFISDHFIRGARFJSDFOSDCNAXCNC");
      }
    },
    _ => { // AC
      println!("{}", if x >= 30 { "Yes" } else { "No" });
    },
  }
}


print(Int(readLine()!)! >= 30 ? "Yes" : "No")


let X = Int(readLine()!)!
print(X >= 30 ? "Yes" : "No")


print(Int(readLine()!)! >= 30 ? "Yes":"No")


func main() {
    let x = readLine()!.split(separator: " ").map{Int($0)!}
    print(x >= 30 ? "Yes" : "No")
}

main()


let input=readLine()!
let deg = Int(input)
if(deg >= 30){
  print("Yes")
}
else{
print("No")
}


import Foundation
let main: () = {
    let X = nextInt()
    print(X >= 30 ? "Yen" : "No")
}()

//----------------------------------

let dx = [1, 0, -1, 0] //[1, 0, -1, 0, -1,  1, -1, 1]
let dy = [0, 1, 0, -1] //[0, 1, 0, -1, -1, -1,  1, 1]

@inlinable func gcd(_ a: Int, _ b: Int) -> Int { (b > 0) ? gcd(b, a % b) : a }
@inlinable func lcm(_ a: Int, _ b: Int) -> Int { a / gcd(a, b) * b }

//----------------------------------

infix operator  =~ : ComparisonPrecedence
infix operator !=~ : ComparisonPrecedence
func =~ <T: FixedWidthInteger>(left: T, right: Range<T>) -> Bool { right ~= left }
func !=~ <T: FixedWidthInteger>(left: T, right: Range<T>) -> Bool { !(right ~= left) }
func =~ <T: FixedWidthInteger>(left: T, right: ClosedRange<T>) -> Bool { right ~= left }
func !=~ <T: FixedWidthInteger>(left: T, right: ClosedRange<T>) -> Bool { !(right ~= left) }

func =~ <T: Collection > (left: T.Element, right: T) -> Bool where T.Element : Equatable { right.contains(left) }
func !=~ <T: Collection > (left: T.Element, right: T) -> Bool where T.Element : Equatable { !right.contains(left) }

infix operator /^ : MultiplicationPrecedence
infix operator /^= : AssignmentPrecedence
func /^ <T: FixedWidthInteger>(left: T, right: T) -> T { (left + (right - 1)) / right }
func /^= <T: FixedWidthInteger>(left: inout T, right: T) { left = (left + (right - 1)) / right }

@inlinable func chmax<T: Comparable>(_ m: inout T, _ q: T) { if (m < q) { m = q } }
@inlinable func chmin<T: Comparable>(_ m: inout T, _ q: T) { if (m > q) { m = q } }
@inlinable func chRmax<T: Comparable>(_ m: inout T, _ q: T) -> Bool { if (m < q) { m = q; return true } else { return false } }
@inlinable func chRmin<T: Comparable>(_ m: inout T, _ q: T) -> Bool { if (m > q) { m = q; return true } else { return false } }

prefix operator *
prefix func * <T> (a: [T]) -> (T, T) { (a[0], a[1]) }
prefix func * <T> (a: [T]) -> (T, T, T) { (a[0], a[1], a[2]) }
prefix func * <T> (a: [T]) -> (T, T, T, T) { (a[0], a[1], a[2], a[3]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T) { (a[0], a[1], a[2], a[3], a[4]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T, T) { (a[0], a[1], a[2], a[3], a[4], a[5]) }

func printErr(_ str: String, terminator: String = "\n") {
    let s = str + terminator
    FileHandle.standardError.write(s.data(using: .utf8)!)
    FileHandle.standardError.synchronizeFile()
}

@inlinable func next() -> String { readLine()! }
@inlinable func nextInt() -> Int { Int(next())! }
@inlinable func nextDouble() -> Double { Double(next())! }
@inlinable func listOfString() -> [String] { next().split(separator: " ").map(String.init) }
@inlinable func listOfInt() -> [Int] { listOfString().map { Int($0)! } }
@inlinable func listOfInt(_ offset: Int = 0) -> [Int] { listOfString().map { Int($0)! + offset } }
@inlinable func listOfInt(_ offsets: Int ...) -> [Int] { listOfString().enumerated().map { Int($0.element)! + offsets[$0.offset % offsets.count] } }
@inlinable func listOfDouble(_ offset: Double = 0.0) -> [Double] { listOfString().map { Double($0)! + offset } }
@inlinable func listOfDouble(_ offsets: Double ...) -> [Double] { listOfString().enumerated().map { Double($0.element)! + offsets[$0.offset % offsets.count] } }

extension Int {
    init(s: String) { self.init(s)! }
    var isEven: Bool { self.isMultiple(of: 2) }
    var isOdd: Bool { !self.isEven }
    var isTrue: Bool { self != 0 }
    var isFalse: Bool { !self.isTrue }
    var toString: String { String(self) }
    var toChar: Character { Character(UnicodeScalar(UInt8(self))) }
}
func + (left: Int, right: Bool) -> Int { left + (right ? 1 : 0) }
extension Character {
    var asciiCode: Int { Int(self.asciiValue!) }
    var string: String { String(self) }
}
extension String {
    @inlinable subscript (position: Int) -> Character { self[self.index(self.startIndex, offsetBy: position)] }
    @inlinable func repeate(_ times: Int) -> String { String(repeating: self, count: times) }
    //  @inlinable subscript (n: Int) -> String { String(self[self.index(self.startIndex, offsetBy: n)]) }
    //  @inlinable subscript (n: Int) -> Int { Int(self[self.index(self.startIndex, offsetBy: n)].asciiValue!) }
    var toInt: Int { Int(self)! }
}
extension String { // VB like
    @inlinable func _index(_ position: Int) -> String.Index! {
        if !(0 ..< self.count ~= position) { return nil }
        return self.index(self.startIndex, offsetBy: position)
    }
    @inlinable func mid(from index: Int, length: Int) -> String! {
        if let startPosition = self._index(index) {
            if let endPosition = self._index(index + length - 1) {
                return String(self[startPosition...endPosition])
            } else {
                let endPosition = self.index(before: self.endIndex)
                return String(self[startPosition...endPosition])
            }
        }
        return ""
    }
    @inlinable func left(_ length: Int) -> String { String(self.prefix(length)) }
    @inlinable func right(_ length: Int) -> String { String(self.suffix(length)) }
}

extension Dictionary {
    @inlinable mutating func getOrSet(_ key: Key, _ defaultValue: () -> Value) -> Value {
        if let stored = self[key] { return stored }
        else {
            let newValue = defaultValue()
            self[key] = newValue
            return newValue
        }
    }
    @inlinable mutating func getOrElse(_ key: Key, _ defaultValue: () -> Value) -> Value {
        if let stored = self[key] { return stored } else { return defaultValue() }
    }
    @inlinable func containsKey(_ key: Key) -> Bool { self.keys.contains(key) }
}

extension Set {
    static func += (left: inout Set<Element>, right: Element) { left.insert(right) }
    static func -= (left: inout Set<Element>, right: Element) { left.remove(right) }
}

extension Array {
    static func += (left: inout Array<Element>, right: Element) { left.append(right) }
    init(_ size: Int, _ initValue: ((Int) -> Element)) {
        self = [Element]()
        for index in 0 ..< size {
            let value = initValue(index)
            self.append(value)
        }
    }
    init(_ size: Int, _ initValue: (() -> Element)) {
        self = [Element]()
        for _ in 0 ..< size {
            let value = initValue()
            self.append(value)
        }
    }
}
typealias IntArray = Array<Int>
typealias DoubleArray = Array<Double>
typealias BoolArray = Array<Bool>
typealias StringArray = Array<String>

extension Array where Element == Int {
    init(_ size: Int) {
        self = [Element](repeating: 0, count: size)
    }
}
extension Array where Element == Double {
    init(_ size: Int) {
        self = [Element](repeating: 0.0, count: size)
    }
}
extension Array where Element == Bool {
    init(_ size: Int) {
        self = [Element](repeating: false, count: size)
    }
}
extension Array where Element == String {
    init(_ size: Int) {
        self = [Element](repeating: "", count: size)
    }
}

extension Array {
    @inlinable func count(_ predicate: ((Element) -> Bool)) -> Int {
        var cnt = 0; for e in self { if (predicate(e)) { cnt += 1 } }
        return cnt
    }
    @inlinable func groupBy<K>(_ keySelector: (Element) -> K) -> [K : [Element]] {
        var destination = [K : [Element]]()
        for element in self {
            let key = keySelector(element)
            var list = destination.getOrSet(key) { [Element]() }
            list.append(element)
            destination[key] = list
        }
        return destination
    }
    @inlinable func groupByIndexed<K>(_ keySelector: (Element) -> K) -> [K : [Int]] {
        var destination = [K : [Int]]()
        for element in self.enumerated() {
            let key = keySelector(element.element)
            var list = destination.getOrSet(key) { [Int]() }
            list.append(element.offset)
            destination[key] = list
        }
        return destination
    }
}

extension Array {
    func binarySearch(_ element: Element, by compare: (Element, Element) -> Int, fromIndex: Int = 0, toIndex: Int = -1) -> Int {
        var low = fromIndex
        var high = (toIndex == -1) ? self.count - 1 : toIndex - 1
        while (low <= high) {
            let mid = (low + high) >> 1 // safe from overflows
            let midVal = self[mid]
            let cmp = compare(midVal, element)
            if (cmp < 0) { low = mid + 1 }          //-1
            else if (0 < cmp) { high = mid - 1 }    // 1
            else { return mid } // key found        // 0
        }
        return -(low + 1)  // key not found
    }
}
extension Array where Element : Comparable {
    func binarySearch(_ element: Element, fromIndex: Int = 0, toIndex: Int = -1) -> Int {
        var low = fromIndex
        var high = (toIndex == -1) ? self.count - 1 : toIndex - 1
        while (low <= high) {
            let mid = (low + high) >> 1 // safe from overflows
            let midVal = self[mid]
            if (midVal < element) { low = mid + 1 }
            else if (midVal > element) { high = mid - 1 }
            else { return mid } // key found
        }
        return -(low + 1)  // key not found
    }
}

extension Array where Element == Int {
    @inlinable func distinct() -> [Element] {
        var set = Set<Element>(), ary = [Element]()
        for n in self.indices { if !set.contains(self[n]) { ary.append(self[n]); set.insert(self[n]) } }
        return ary
    }
    @inlinable func any(_ predicate: (Element) -> Bool) -> Bool {
        var any = false; for element in self { if predicate(element) { any = true } }
        return any
    }
    @inlinable func all(_ predicate: (Element) -> Bool) -> Bool {
        self.allSatisfy(predicate)
    }
    @inlinable func sum() -> Element { self.reduce(0, +) }
    @inlinable func sum(by predicate: (Element) -> Element) -> Element {
        var sum = 0; for e in self { sum += predicate(e) }
        return sum
    }
    @inlinable func joinToString(_ sepatator: String = " ") -> String { self.map { String($0) }.joined(separator: sepatator) }
}

extension Array where Element == Double {
    @inlinable func sum() -> Element { self.reduce(0.0, +) }
    @inlinable func sum(by predicate: (Element) -> Element) -> Element {
        var sum = 0.0; for e in self { sum += predicate(e) }
        return sum
    }
    @inlinable func joinToString(_ sepatator: String = " ") -> String { self.map { String($0) }.joined(separator: sepatator) }
}
extension Array where Element == String {
    @inlinable func toIntDouble() -> (Int, Double) { (Int(self[0])!, Double(self[1])!) }
    @inlinable func toIntString() -> (Int, String) { (Int(self[0])!, self[1]) }
    @inlinable func toIntIntString() -> (Int, Int, String) { (Int(self[0])!, Int(self[1])!, self[2]) }
}

@inlinable func block( _ action: () -> Void) {
    action()
}
@inlinable func repeate(_ times1: Int, _ action: () -> Void) {
    for _ in 0 ..< times1 { action() }
}
@inlinable func repeate(_ times1: Int, _ action: (Int) -> Void) {
    for index1 in 0 ..< times1 {
        action(index1)
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ action: (Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            action(index1, index2)
        }
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ times3: Int, _ action: (Int, Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            for index3 in 0 ..< times3 {
                action(index1, index2, index3)
            }
        }
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ times3: Int, _ times4: Int, _ action: (Int, Int, Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            for index3 in 0 ..< times3 {
                for index4 in 0 ..< times4 {
                    action(index1, index2, index3, index4)
                }
            }
        }
    }
}

func measureTimeSeconds(block: (() -> Void)) -> Double {
    let startTime = Date()
    block()
    let duration = -startTime.timeIntervalSinceNow
    return duration
}

public class PriorityQueue<T> {
    private final var _heap: [T]
    private let compare: (T, T) -> Bool
    public init(_ compare: @escaping (T, T) -> Bool) {
        _heap = []
        self.compare = compare
    }
    public func push(_ newElement: T) {
        _heap.append(newElement)
        _ = siftUp(index: _heap.endIndex - 1)
    }
    public func peek() -> T? {
        if _heap.count == 0 { return nil }
        return _heap[0]
    }
    public func pop() -> T? {
        if _heap.count == 0 { return nil }
        _heap.swapAt(0, _heap.endIndex - 1)
        let pop = _heap.removeLast()
        _ = siftDown(index: 0)
        return pop
    }
    private func siftDown(index: Int) -> Bool {
        let left = index * 2 + 1
        let right = index * 2 + 2
        var smallest = index
        if left < _heap.count && compare(_heap[left], _heap[smallest]) { smallest = left }
        if right < _heap.count && compare(_heap[right], _heap[smallest]) { smallest = right }
        if smallest != index {
            _heap.swapAt(index, smallest)
            _ = siftDown(index: smallest)
            return true
        }
        return false
    }
    private func siftUp(index: Int) -> Bool {
        if index == 0 { return false }
        let parent = (index - 1) >> 1
        if compare(_heap[index], _heap[parent]) {
            _heap.swapAt(index, parent)
            _ = siftUp(index: parent)
            return true
        }
        return false
    }
}
extension PriorityQueue {
    public var count: Int { return _heap.count }
    public var isEmpty: Bool { return _heap.isEmpty }
    public func update<T2>(element: T2) -> T? where T2: Equatable {
        assert(element is T)  // How to enforce this with type constraints?
        for (index, item) in _heap.enumerated() {
            if (item as! T2) == element {
                _heap[index] = element as! T
                if siftDown(index: index) || siftUp(index: index) { return item }
            }
        }
        return nil
    }
    public func remove<T2>(element: T2) -> T? where T2: Equatable {
        assert(element is T)  // How to enforce this with type constraints?
        for (index, item) in _heap.enumerated() {
            if (item as! T2) == element {
                _heap.swapAt(index, _heap.endIndex - 1)
                _heap.removeLast()
                _ = siftDown(index: index)
                return item
            }
        }
        return nil
    }
    public var heap: [T] { return _heap }
    public func removeAll() { _heap.removeAll() }
    public func addAll(_ elements: [T]) { for e in elements { self.push(e) } }
}


import * as fs from 'fs';

const x: number = parseInt(fs.readFileSync('/dev/stdin', 'utf8').trim(), 10);
console.log(x >= 30 ? 'Yes' : 'No');


import * as fs from 'fs';

// main
function main(input: string[]) {
    // param
    var x: number;
    var ans: string;
    // init
    x = Number(input[0]);
    // solve
    if (30 <= x)
        ans = "Yes"
    else
        ans = "No";
    // answer
    console.log(ans);
}

// graph lib
/*
function GRAPH_enumPattern(cur: number[], pat: number[][]): number[][] {
    var arr = [];
    for (var patx = 0; patx < pat.length; patx++) {
        var pos = [cur[0] + pat[patx][0], cur[1] + pat[patx][1]];
        arr.push(pos);
    }
    return arr;
}
*/

// math lib
/*
function Math_max(arr: number[]): number { return arr.reduce((x, y) => Math.max(x, y)); }
function Math_min(arr: number[]): number { return arr.reduce((x, y) => Math.min(x, y)); }
function Math_gcd(): number {
    var ans = arguments[0];
    var f = (a: number, b: number): number => b ? f(b, a % b) : a
    for (var i = 1; i < arguments.length; i++) {
        ans = f(ans, arguments[i]);
    }
    return ans
};
function Math_gcdArray(values: number[]): number {
    var ans = values[0];
    var f = (a: number, b: number): number => b ? f(b, a % b) : a
    for (var i = 1; i < values.length; i++) {
        ans = f(ans, values[i]);
    }
    return ans
};
function Math_lcm(): number {
    var a = arguments
    var g = (n: number, m: number): number => m ? g(m, n % m) : n
    var l = (n: number, m: number): number => n * m / g(n, m)
    var ans = a[0]
    for (var i = 1; i < a.length; i++) {
        ans = l(ans, a[i])
    }
    return ans
}
function Math_lcmArray(values: number[]): number {
    var a = values
    var g = (n: number, m: number): number => m ? g(m, n % m) : n
    var l = (n: number, m: number): number => n * m / g(n, m)
    var ans = a[0]
    for (var i = 1; i < a.length; i++) {
        ans = l(ans, a[i])
    }
    return ans
}
function Math_primeList(value: number): number[] {
    var ans = [];
    var arr = new Array(value).fill(0);
    for (var i = 2; i < value; i++) {
        if (arr[i] == 0) {
            for (var j = i; j < value; j += i) {
                if (arr[j] == 0) arr[j] = i;
            }
        }
    }
    for (var i = 2; i < value; i++) {
        if (arr[i] == i) ans.push(i);
    }
    return ans;
}
function Math_primeFactor(p: number[], value: number): number[][] {
    var ans: number[][] = [];
    var valmax = value / 2;;
    for (var i = 0; i < p.length; i++) {
        var prime = p[i];
        if (valmax < prime) break;
        var count = 0;
        while (value % prime == 0) {
            value /= prime;
            count++;
        }
        if (count != 0) {
            ans.push([prime, count]);
        }
        if (value == 1) break;
    }
    return ans;
}
*/

// union-find lib
/*
var g_uf_root: number[];
var g_uf_count: number[];
function UF_initRoot(num: number) {
    g_uf_root = new Array(num).fill(-1);
    g_uf_count = new Array(num).fill(1);
}
function UF_getRoot(index: number) {
    if (g_uf_root[index] < 0) {
        return index;
    } else {
        var work0: number = UF_getRoot(g_uf_root[index]);
        g_uf_root[index] = work0;
        return work0
    }
}
function UF_mergeRoot(a: number, b: number) {
    var root0: number = UF_getRoot(a);
    var root1: number = UF_getRoot(b);
    if (root0 == root1) return;
    if (root0 > root1) [root0, root1] = [root1, root0];
    g_uf_count[root0] += g_uf_count[root1];
    g_uf_count[root1] = 0;
    g_uf_root[root1] = root0;
}
*/

// entrypoint
function entrypoint() {
    try {
        // linux
        var 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 () {
            input = lines;
            main(input);
        });
    }
}
entrypoint();


{
  const run = (input: string) => {
    const x = parseInt(input.trim())
    return x >= 30 ? 'Yes' : 'No'
  }

  const Main = (input: string) => {
    console.log(run(input))
  };

  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}


import * as fs from 'fs';

const x: number = parseInt(fs.readFileSync('/dev/stdin/', 'utf8').trim(), 10);
console.log(x >= 30 ? 'Yes' : 'No');


import * as fs from 'fs';

const x: number = parseInt(fs.readFileSync('/dev/stdin/', 'utf8').trim(), 10);

console.log(x >= 30 ? 'Yes' : 'No');


import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main(H, K):
    N = len(H)
    INF = 10**9
    dp = np.full(N + K, INF, np.int32)
    dp[0] = 0
    for n in range(N):
        for k in range(1, K + 1):
            dp[n + k] = min(dp[n + k], dp[n] + abs(H[n] - H[n + k]))
    return dp[N - 1]

signature = '(i4[:],i4)'
if sys.argv[-1] == 'ONLINE_JUDGE':
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('main', signature)(main)
    cc.compile()

from my_module import main

N, K = map(int, readline().split())
H = np.array(read().split(), np.int32)

print(main(H, K))


def jmp(h,k):
    n=len(h)
    dp=[1000000000 for i in range(n+1)]
    dp[0]=0
    dp[1]=abs(h[1]-h[0])
    for i in range(n+1):
        for j in range(i+1,i+k+1):
            if(j<n):
                dp[j]=min(dp[j],dp[i]+abs(h[i]-h[j]))
    # print(dp)
    return dp[n-1]

n,k=map(int,input().split())
l=list(map(int,input().split()))
print(jmp(l,k))


import sys
INFTY=sys.maxsize

def readinput():
    n,k=list(map(int,input().split()))
    h=list(map(int,input().split()))
    return n,k,h

def main(n,k,h):
    dp=[INFTY]*n
    dp[0]=0
    for i in range(n):
        for j in range(1,k+1):
            if i+j<n:
                dp[i+j]=min(dp[i+j],dp[i]+abs(h[i]-h[i+j]))
    return dp[n-1]

if __name__=='__main__':
    n,k,h=readinput()
    ans=main(n,k,h)
    print(ans)


def chmin(dp, a, b):
    if dp[a] > b:
        dp[a] = b
        return True
    return False

def chmax(dp, a, b):
    if dp[a] < b:
        dp[a] = b
        return True
    return False

import sys
input = sys.stdin.readline
import numpy as np

def main(step, JumpMax, height):
    inf = float('inf')
    dp = np.array([inf for i in range(step)])
    dp[0] = 0
    for j in range(1, step):
        for l in range(1, JumpMax+1):
            if j >= l:
                chmin(dp, j, dp[j-l] + abs(height[j]-height[j-l]))

    print(int(dp[step-1]))

n, k = map(int, input().split())
h = list(map(int, input().split()))
main(n, k, h)


N, K = map(int, input().split())
h = list(map(int, input().split()))

DP = [0]
for i in range(N - 1):
    act = float("inf")
    for k in range(K):
        if i - k < 0: continue
        act = min(DP[-1 - k] + abs(h[i - k] - h[i + 1]), act)
    DP += [act]

print(DP[-1])


import numpy as np

MAX_SIZE = 10**6

def chmin(a,b):
    a = a if a < b else b
    return a

def chmax(a, b):
    a = a if a > b else b
    return a

N, K = (input().split())
N=int(N)
K=int(K)

h_point = []
temp = input().split()
for i in range(N):
    h_point.append(int(temp[i]))

# initilize
costs = []
for i in range(N):
    costs.append(MAX_SIZE)

costs[0] = 0
for i in range(N):
    ans_temp = costs[i]
    for j in range(1, K+1):
        if (i - j) < 0:
            continue
        ans_temp = chmin(ans_temp, costs[i-j]+abs(h_point[i]-h_point[i-j]))

    costs[i] = ans_temp

print(costs[N-1])


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

public class Main {
    //static String probName = "template";
    static Comparator<int[]> comp = new Comparator<int[]>() {
        public int compare(int[] a, int[] b) {
            for (int i=0; i<a.length; i++) {
                if (a[i] < b[i])       return -1;
                else if (a[i] > b[i])  return 1;
            }
            return 0;
        }
    };
    static final long LARGE_LONG = 1000000000000000000L;
    static final int LARGE_INT = 1000000007;
    static final int[] dx = new int[] {1, -1, 0, 0};
    static final int[] dy = new int[] {0, 0, 1, -1};
    static int n;
    static int k;
    static int[] frgs;
    static int[] store;

    public static void main(String[] argst) throws IOException {
        FastReader in = new FastReader();
        // FastReader in = new FastReader(probName + ".in");
        // Scanner in = new Scanner(System.in);

        // PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(probName + ".out")));
        PrintWriter out = new PrintWriter(System.out);
        n = in.nextInt();
        k = in.nextInt();
        frgs = new int[n];
        store = new int[n];
        for (int i = 0; i < n; i++) {
            frgs[i] = in.nextInt();
        }
        for (int i = 1; i < n; i++) {
            int m = store[i-1] + Math.abs(frgs[i]-frgs[i-1]);
            for (int j = i - 2; j >= i - k && j >= 0; j--) {
                m = Math.min(m, store[j] + Math.abs(frgs[i] - frgs[j]));
            }
            store[i] = m;
        }
        out.println(store[n-1]);
        out.close();
    }

    /* FastReader code from  https://www.geeksforgeeks.org/fast-io-in-java-in-competitive-programming/
       nextLine modified, and added next(), and hasNext()
    */
    static class FastReader {
        final private int BUFFER_SIZE = 1 << 16;
        final private int MAX_LINE_SIZE = 1 << 20;
        private DataInputStream din;
        private byte[] buffer, lineBuf;
        private int bufferPointer, bytesRead;

        public FastReader() {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }
        public FastReader(String file_name) throws IOException {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }
        public boolean hasNext() throws IOException {
            byte c;
            while ((c = read()) != -1) {
                if (c > ' ') {
                    bufferPointer--;
                    return true;
                }
            }
            return false;
        }
        public String nextLine() throws IOException {
            if (lineBuf == null)	lineBuf = new byte[MAX_LINE_SIZE];
            int ctr = 0;
            byte c;
            while ((c = read()) != -1) {
                if (c == '\r')        continue;
                if (c == '\n')        break;
                lineBuf[ctr++] = c;
            }
            return new String(lineBuf, 0, ctr);
        }
        public String next() throws IOException {
            if (lineBuf == null)	lineBuf = new byte[MAX_LINE_SIZE];
            int ctr = 0;
            byte c = read();
            while (c <= ' ')  	c = read();
            while (c > ' ') {
                lineBuf[ctr++] = c;
                c = read();
            }
            return new String(lineBuf, 0, ctr);
        }
        public int nextInt() throws IOException {
            int ret = 0;
            byte c = read();
            while (c <= ' ')   c = read();
            boolean neg = (c == '-');
            if (neg)           c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (neg)           return -ret;
            return ret;
        }
        public long nextLong() throws IOException {
            long ret = 0;
            byte c = read();
            while (c <= ' ')    c = read();
            boolean neg = (c == '-');
            if (neg)            c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
            if (neg)            return -ret;
            return ret;
        }
        public double nextDouble() throws IOException {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)  	c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (c == '.') {
                while ((c = read()) >= '0' && c <= '9') {
                    ret += (c - '0') / (div *= 10);
                }
            }
            if (neg)     return -ret;
            return ret;
        }
        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }
        private byte read() throws IOException {
            if (bufferPointer == bytesRead)     fillBuffer();
            return buffer[bufferPointer++];
        }
        public void close() throws IOException {
            if (din == null) 	   return;
            din.close();
        }
    }
}


import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    static InputStream is;
    static PrintWriter out;
    static String INPUT = "";

    static void solve() {
        // Set up
        int N = ni();
        int K = ni();
        int[] h = new int[110000];
        for (int i = 0; i < N; i++) {
            h[i] = ni();
        }

        // 最小化問題なので、MAX_VALUEで初期化。
        // 範囲を超えても大丈夫なように配列のサイズも最大に。
        int[] dp = new int[110000];
        for (int i = 0; i < 110000; i++) {
            dp[i] = Integer.MAX_VALUE;
        }

        // 配るDP。
        dp[0] = 0;
        for (int i = 0; i < N; i++) {
            for (int j = 1; j <= K; j++) {
                dp[i + j] = Math.min(dp[i + j], dp[i] + Math.abs(h[i] - h[i + j]));
            }
        }

        out.println(dp[N - 1]);
    }

    public static void main(String[] args) throws Exception {
        long S = System.currentTimeMillis();
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        out = new PrintWriter(System.out);

        solve();
        out.flush();
        long G = System.currentTimeMillis();
        tr(G-S+"ms");
    }

    private static boolean eof() {
        if(lenbuf == -1)return true;
        int lptr = ptrbuf;
        while(lptr < lenbuf)if(!isSpaceChar(inbuf[lptr++]))return false;

        try {
            is.mark(1000);
            while(true){
                int b = is.read();
                if(b == -1){
                    is.reset();
                    return true;
                }else if(!isSpaceChar(b)){
                    is.reset();
                    return false;
                }
            }
        } catch (IOException e) {
            return true;
        }
    }

    private static byte[] inbuf = new byte[1024];
    static int lenbuf = 0, ptrbuf = 0;

    private static int readByte() {
        if(lenbuf == -1)throw new InputMismatchException();
        if(ptrbuf >= lenbuf){
            ptrbuf = 0;
            try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
            if(lenbuf <= 0)return -1;
        }
        return inbuf[ptrbuf++];
    }

    private static boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }

    private static int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

    private static double nd() { return Double.parseDouble(ns()); }
    private static char nc() { return (char)skip(); }

    private static String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b))){
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private static char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))){
            buf[p++] = (char)b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private static char[][] nm(int n, int m) {
        char[][] map = new char[n][];
        for(int i = 0;i < n;i++)map[i] = ns(m);
        return map;
    }

    private static int[] na(int n) {
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = ni();
        return a;
    }

    private static int ni() {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private static long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private static void tr(Object... o) { if(INPUT.length() != 0)System.out.println(Arrays.deepToString(o)); }

    // Union-Find
    // https://algs4.cs.princeton.edu/15uf/UF.java.html
    public static class UnionFind {
        private int count = 0;
        private int[] parent, rank;

        public UnionFind(int n) {
            count = n;
            parent = new int[n];
            rank = new int[n];
            for (int i = 0; i < n; i++) {
                parent[i] = i;
            }
        }

        public int find(int p) {
            while (p != parent[p]) {
                parent[p] = parent[parent[p]];
                p = parent[p];
            }
            return p;
        }

        public void union(int p, int q) {
            int rootP = find(p);
            int rootQ = find(q);
            if (rootP ==rootQ) return;
            if (rank[rootQ] > rank[rootP]) {
                parent[rootP] = rootQ;
            } else {
                parent[rootQ] = rootP;
                if (rank[rootP] == rank[rootQ]) {
                    rank[rootP]++;
                }
            }
            count--;
        }

        public int count() {
            return count;
        }

        public void print() {
            out.println("Parent:");
            for (int i : parent) {
                out.print(i);
                out.print(" ");
            }
            out.println();
            out.println("Rank:");
            for (int i : rank) {
                out.print(i);
                out.print(" ");
            }
            out.println();
        }
    }

    // Dijkstra
    // Return min distance from start to end O(ElogV) (negative cost is prohibited)
    // edge is int[3] array {from,to,cost}
    // edges is edge list from specific node
    // all_edges is Map<from node number,edges>
    static int dijkstra(Map<Integer,List<int[]>> all_edges,int start,int end,int max_node_number) {
        int[] distance = new int[max_node_number + 1];
        Arrays.fill(distance, -1);
        PriorityQueue<int[]> p_que = new PriorityQueue<>((a,b) -> ((distance[a[0]] + a[2]) - (distance[b[0]] + b[2])));
        distance[start] = 0;
        List<int[]> edges = all_edges.get(start);
        p_que.addAll(edges);
        while (distance[end] < 0) {
            int[] nearest_edge = p_que.poll();
            assert nearest_edge != null;
            if (distance[nearest_edge[1]] < 0) {
                distance[nearest_edge[1]] = distance[nearest_edge[0]] + nearest_edge[2];
                if (all_edges.containsKey(nearest_edge[1])) {
                    edges = all_edges.get(nearest_edge[1]);
                    for (int[] edge : edges) {
                        if (distance[edge[1]] < 0) p_que.add(edge);
                    }
                }
            }
        }
        return distance[end];
    }

    // Enumerate primes in [2, n] with O(n log log n)
    public static List<Integer> sieveOfEratosthenes(int n) {
        boolean[] isPrime = new boolean[n+1];
        Arrays.fill(isPrime, true);
        for (int i = 2; i * i <= n; i++) {
            if (isPrime[i]) {
                for (int j = i + i; j <= n; j += i) {
                    isPrime[j] = false;
                }
            }
        }
        List<Integer> primes = new ArrayList<>();
        for (int i = 2; i <= n; i++) {
            if (isPrime[i]) {
                primes.add(i);
            }
        }
        return primes;
    }

    // Count divisor
    public static int countDivisor(int n) {
        int[] list = new int[n + 1];
        Arrays.fill(list, 0);
        int num = n;
        for (int i = 2; i <= n; i++) {
            while (num % i == 0) {
                list[i] = list[i] + 1;
                num /= i;
            }
        }
        int ans = 1;
        for (int i : list) {
            ans *= (i + 1);
        }
        return ans;
    }
}