#include <bits/stdc++.h>
#define ll int64_t

#define pmax 1000000007
#define inf 1000000000000000000
#define alt 100002

#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second

#define f(x,y,z) for(ll y=x;y<z;y++)
#define fr(x,y,z) for(ll y=z-1;y>=x;y--)
#define fv(x,y) for(auto x=y.begin();x!=y.end();x++)
#define all(x) x.begin(),x.end()
#define outv(x) for(auto i=x.begin();i!=x.end();i++) cout<<*i<<' '; cout<<endl;
#define outvll(x) for(auto i=x.begin();i!=x.end();i++)	cout<<*i.ff<<' '<<*i.ss<<'\t';	cout<<endl;

using namespace std;

/*
bool sv[alt];
void fillsv(ll x)
{
    memset(sv,true,sizeof(sv));
    sv[0]=sv[1]=false;
    for(ll p=2;p*p<=x;p++)
        if(sv[p]==true)
            for(ll i=p*p;i<=x;i+=p)
                sv[i]=false;
}
*/

inline ll max(ll a,ll b)
{
    return (a>b)?a:b;
}

inline ll min(ll a,ll b)
{
    return (a<b)?a:b;
}

inline ll max3(ll a,ll b,ll c)
{
    return max(a,max(b,c));
}

inline ll min3(ll a,ll b,ll c)
{
    return min(a,min(b,c));
}

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

ll pow3(ll a,ll b, ll m=pmax)
{
    ll res=1;
    while(b>0)
    {
        if(b&1)
            res=(res*a)%m;
        a=(a*a)%m;
        b>>=1;
    }
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //fillsv(alt);
    ll t=1;
    //cin>>t;
    while(t--)
    {
        ll w,h;
        cin>>h>>w;
        string s[h];
        f(0,i,h)
            cin>>s[i];
        ll ans=0,flag=0,fa=0;
        //f(0,x,h)
        //{
            //f(0,y,w)
                //cout<<s[x][y];
            //cout<<endl;
        //}
        f(0,i,h)
            f(0,j,w)
            {
                //cout<<"position "<<i<<" "<<j<<endl;
                if(s[i][j]=='*')
                {
                    if(flag==1)
                    {
                        cout<<"NO";
                        return 0;
                    }
                    else
                    {
                        ll dc=0,l1=i+1,rc=0,rc1=0;
                        for(;i+dc<h&&s[i+dc][j]=='*';dc++)
                        {
                            //cout<<" checking "<<i+dc<<" "<<j<<endl;
                        }
                        if(dc>2)
                            ans++;
                        for(;l1<h&&j+rc>0&&j+rc<w&&s[l1][j+rc]=='*';rc++)
                        {
                            //cout<<" checking "<<l1<<" "<<j+rc<<endl;
                        }
                        for(;l1<h&&j-rc1>=0&&j-rc1<w&&s[l1][j-rc1]=='*';rc1++)
                        {
                            //cout<<" checking "<<l1<<" "<<j-rc1<<endl;
                        }
                        if(rc+rc1>=4)
                            ans++;
                        if(ans==2)
                        {
                            //cout<<"satisfies with dc "<<dc<<" and rc "<<rc<<endl;
                            f(0,x,dc)
                            {
                                //cout<<" changing "<<i+x<<" "<<j<<endl;
                                s[i+x][j]='.';
                            }
                            f(0,y,rc)
                            {
                                //cout<<" changing "<<l1<<" "<<l2+y<<endl;
                                s[l1][j+y]='.';
                            }
                            f(0,y,rc1)
                            {
                                s[l1][j-y]='.';
                            }
                            flag=1;
                            //f(0,x,h)
                            //{
                                //f(0,y,w)
                                    //cout<<s[x][y];
                                //cout<<endl;
                            //}
                        }
                        else
                        {
                            fa=1;
                            ans=0;
                        }
                    }
                }
            }
        if(flag==1&&fa==0)
            cout<<"YES";
        else
            cout<<"NO";
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll int64_t

#define pmax 1000000007
#define inf 1000000000000000000
#define alt 100002

#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second

#define f(x,y,z) for(ll y=x;y<z;y++)
#define fr(x,y,z) for(ll y=z-1;y>=x;y--)
#define fv(x,y) for(auto x=y.begin();x!=y.end();x++)
#define all(x) x.begin(),x.end()
#define outv(x) for(auto i=x.begin();i!=x.end();i++) cout<<*i<<' '; cout<<endl;
#define outvll(x) for(auto i=x.begin();i!=x.end();i++)	cout<<*i.ff<<' '<<*i.ss<<'\t';	cout<<endl;

using namespace std;

/*
bool sv[alt];
void fillsv(ll x)
{
    memset(sv,true,sizeof(sv));
    sv[0]=sv[1]=false;
    for(ll p=2;p*p<=x;p++)
        if(sv[p]==true)
            for(ll i=p*p;i<=x;i+=p)
                sv[i]=false;
}
*/

inline ll max(ll a,ll b)
{
    return (a>b)?a:b;
}

inline ll min(ll a,ll b)
{
    return (a<b)?a:b;
}

inline ll max3(ll a,ll b,ll c)
{
    return max(a,max(b,c));
}

inline ll min3(ll a,ll b,ll c)
{
    return min(a,min(b,c));
}

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

ll pow3(ll a,ll b, ll m=pmax)
{
    ll res=1;
    while(b>0)
    {
        if(b&1)
            res=(res*a)%m;
        a=(a*a)%m;
        b>>=1;
    }
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //fillsv(alt);
    ll t=1;
    //cin>>t;
    while(t--)
    {
        ll w,h;
        cin>>h>>w;
        string s[h];
        f(0,i,h)
            cin>>s[i];
        ll ans=0,flag=0;
        //f(0,x,h)
        //{
            //f(0,y,w)
                //cout<<s[x][y];
            //cout<<endl;
        //}
        f(0,i,h)
            f(0,j,w)
            {
                //cout<<"position "<<i<<" "<<j<<endl;
                if(s[i][j]=='*')
                {
                    if(flag==1||i==h-1||i==h-2||j==0||j==w-1)
                    {
                        cout<<"NO";
                        return 0;
                    }
                    else
                    {
                        ll dc=0,l1=i+1,l2=j-1,rc=0;
                        for(;i+dc<h&&s[i+dc][j]=='*';dc++)
                        {
                            //cout<<" checking "<<l1<<" "<<l2+rc<<endl;
                        }
                        if(dc>2)
                            ans++;
                        for(;l2+rc<w&&s[l1][l2+rc]=='*';rc++)
                        {
                            //cout<<" checking "<<l1<<" "<<l2+rc<<endl;
                        }
                        if(rc>2)
                            ans++;
                        if(ans==2)
                        {
                            //cout<<"satisfies with dc "<<dc<<" and rc "<<rc<<endl;
                            f(0,x,dc)
                            {
                                //cout<<" changing "<<i+x<<" "<<j<<endl;
                                s[i+x][j]='.';
                            }
                            f(0,y,rc)
                            {
                                //cout<<" changing "<<l1<<" "<<l2+y<<endl;
                                s[l1][l2+y]='.';
                            }
                            flag=1;
                            //f(0,x,h)
                            //{
                                //f(0,y,w)
                                    //cout<<s[x][y];
                                //cout<<endl;
                            //}
                        }
                        else ans=0;
                    }
                }
            }
        if(flag==1)
            cout<<"YES";
        else
            cout<<"NO";
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll int64_t
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
using namespace std;
/*
bool sv[1000000];
void fillsv(ll x)
{
    memset(sv,true,sizeof(sv));
    sv[0]=sv[1]=false;
    for(ll p=2;p*p<=x;p++)
        if(sv[p]==true)
            for(ll i=p*p;i<=x;i+=p)
                sv[i]=false;
}*/
inline ll max(ll a,ll b){return (a>b)?a:b;}
inline ll min(ll a,ll b){return (a<b)?a:b;}
inline ll max3(ll a,ll b,ll c){return max(a,max(b,c));}
inline ll min3(ll a,ll b,ll c){return min(a,min(b,c));}
ll gcd(ll a,ll b)
{
    return (a%b==0)?b:gcd(b,a%b);
}
ll pow3(ll a,ll b, ll m=1000000007)
{
    ll res=1;
    while(b>0)
    {
        if(b&1)
            res=(res*a)%m;
        a=(a*a)%m;
        b>>=1;
    }
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //fillsv(1000000);
    int t=1;
    //cin>>t;
    while(t--)
    {
        int h,w;
        cin>>h>>w;
        string s[h];
        int a[h][w];
        for(int i=0;i<h;i++)
        {
            cin>>s[i];
            for(int j=0;j<w;j++)
                if(s[i][j]=='*')
                    a[i][j]=1;
                else a[i][j]=0;
        }
        //for(int i=0;i<h;i++)
        //{
            //for(int j=0;j<w;j++)
                //cout<<a[i][j]<<" ";
            //cout<<endl;
        //}
        int ir=-1,jr=-1;
        for(int i=1;i<h-1;i++)
            for(int j=1;j<w-1;j++)
                if(a[i][j]==1)
                    if(a[i][j+1]==1&&a[i][j-1]==1&&a[i-1][j]==1&&a[i+1][j]==1)
                    {
                        ir=i;
                        jr=j;
                    }
        if(ir==-1)
            cout<<"NO";
        else
        {
            //cout<<"ir="<<ir<<" jr="<<jr<<endl;
            for(int i=ir+1;i<h&&a[i][jr]==1;i++)
                a[i][jr]=0;
            for(int i=ir-1;i>-1&&a[i][jr]==1;i--)
                a[i][jr]=0;
            for(int j=jr+1;j<w&&a[ir][j]==1;j++)
                a[ir][j]=0;
            for(int j=jr-1;j>-1&&a[ir][j]==1;j--)
                a[ir][j]=0;
        //for(int i=0;i<h;i++)
        //{
            //for(int j=0;j<w;j++)
                //cout<<a[i][j]<<" ";
            //cout<<endl;
        //}
        int sum=0;
        for(int i=0;i<h;i++)
            for(int j=0;j<w;j++)
                sum+=a[i][j];
        if(sum==1)
            cout<<"YES";
        else
            cout<<"NO";
        }
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll int64_t

#define pmax 1000000007
#define inf 1000000000000000000
#define alt 100002

#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second

#define f(x,y,z) for(ll y=x;y<z;y++)
#define fr(x,y,z) for(ll y=z-1;y>=x;y--)
#define fv(x,y) for(auto x=y.begin();x!=y.end();x++)
#define all(x) x.begin(),x.end()
#define outv(x) for(auto i=x.begin();i!=x.end();i++) cout<<*i<<' '; cout<<endl;
#define outvll(x) for(auto i=x.begin();i!=x.end();i++)	cout<<*i.ff<<' '<<*i.ss<<'\t';	cout<<endl;

using namespace std;

/*
bool sv[alt];
void fillsv(ll x)
{
    memset(sv,true,sizeof(sv));
    sv[0]=sv[1]=false;
    for(ll p=2;p*p<=x;p++)
        if(sv[p]==true)
            for(ll i=p*p;i<=x;i+=p)
                sv[i]=false;
}
*/

inline ll max(ll a,ll b)
{
    return (a>b)?a:b;
}

inline ll min(ll a,ll b)
{
    return (a<b)?a:b;
}

inline ll max3(ll a,ll b,ll c)
{
    return max(a,max(b,c));
}

inline ll min3(ll a,ll b,ll c)
{
    return min(a,min(b,c));
}

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

ll pow3(ll a,ll b, ll m=pmax)
{
    ll res=1;
    while(b>0)
    {
        if(b&1)
            res=(res*a)%m;
        a=(a*a)%m;
        b>>=1;
    }
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //fillsv(alt);
    ll t=1;
    //cin>>t;
    while(t--)
    {
        ll w,h;
        cin>>h>>w;
        string s[h];
        f(0,i,h)
            cin>>s[i];
        ll ans=0,flag=0;
        //f(0,x,h)
        //{
            //f(0,y,w)
                //cout<<s[x][y];
            //cout<<endl;
        //}
        f(0,i,h)
            f(0,j,w)
            {
                //cout<<"position "<<i<<" "<<j<<endl;
                if(s[i][j]=='*')
                {
                    if(flag==1)
                    {
                        cout<<"NO";
                        return 0;
                    }
                    else
                    {
                        ll dc=0,l1=i+1,l2=j-1,rc=0;
                        for(;i+dc<h&&s[i+dc][j]=='*';dc++)
                        {
                            //cout<<" checking "<<l1<<" "<<l2+rc<<endl;
                        }
                        if(dc>2)
                            ans++;
                        for(;l1<h&&l2+rc>0&&l2+rc<w&&s[l1][l2+rc]=='*';rc++)
                        {
                            //cout<<" checking "<<l1<<" "<<l2+rc<<endl;
                        }
                        if(rc>2)
                            ans++;
                        if(ans==2)
                        {
                            //cout<<"satisfies with dc "<<dc<<" and rc "<<rc<<endl;
                            f(0,x,dc)
                            {
                                //cout<<" changing "<<i+x<<" "<<j<<endl;
                                s[i+x][j]='.';
                            }
                            f(0,y,rc)
                            {
                                //cout<<" changing "<<l1<<" "<<l2+y<<endl;
                                s[l1][l2+y]='.';
                            }
                            flag=1;
                            //f(0,x,h)
                            //{
                                //f(0,y,w)
                                    //cout<<s[x][y];
                                //cout<<endl;
                            //}
                        }
                        else ans=0;
                    }
                }
            }
        if(flag==1)
            cout<<"YES";
        else
            cout<<"NO";
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll int64_t

#define pmax 1000000007
#define inf 1000000000000000000
#define alt 100002

#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second

#define f(x,y,z) for(ll y=x;y<z;y++)
#define fr(x,y,z) for(ll y=z-1;y>=x;y--)
#define fv(x,y) for(auto x=y.begin();x!=y.end();x++)
#define all(x) x.begin(),x.end()
#define outv(x) for(auto i=x.begin();i!=x.end();i++) cout<<*i<<' '; cout<<endl;
#define outvll(x) for(auto i=x.begin();i!=x.end();i++)	cout<<*i.ff<<' '<<*i.ss<<'\t';	cout<<endl;

using namespace std;

/*
bool sv[alt];
void fillsv(ll x)
{
    memset(sv,true,sizeof(sv));
    sv[0]=sv[1]=false;
    for(ll p=2;p*p<=x;p++)
        if(sv[p]==true)
            for(ll i=p*p;i<=x;i+=p)
                sv[i]=false;
}
*/

inline ll max(ll a,ll b)
{
    return (a>b)?a:b;
}

inline ll min(ll a,ll b)
{
    return (a<b)?a:b;
}

inline ll max3(ll a,ll b,ll c)
{
    return max(a,max(b,c));
}

inline ll min3(ll a,ll b,ll c)
{
    return min(a,min(b,c));
}

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

ll pow3(ll a,ll b, ll m=pmax)
{
    ll res=1;
    while(b>0)
    {
        if(b&1)
            res=(res*a)%m;
        a=(a*a)%m;
        b>>=1;
    }
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //fillsv(alt);
    ll t=1;
    //cin>>t;
    while(t--)
    {
        ll w,h;
        cin>>h>>w;
        string s[h];
        f(0,i,h)
            cin>>s[i];
        ll ans=0,flag=0;
        //f(0,x,h)
        //{
            //f(0,y,w)
                //cout<<s[x][y];
            //cout<<endl;
        //}
        f(0,i,h)
            f(0,j,w)
            {
                //cout<<"position "<<i<<" "<<j<<endl;
                if(s[i][j]=='*')
                {
                    if(flag==1)
                    {
                        cout<<"NO";
                        return 0;
                    }
                    else if(i<h-2&&j!=0&&j!=w-1)
                    {
                        ll dc=0,l1=i+1,l2=j-1,rc=0;
                        for(;i+dc<h&&s[i+dc][j]=='*';dc++)
                        {
                            //cout<<" checking "<<l1<<" "<<l2+rc<<endl;
                        }
                        if(dc>2)
                            ans++;
                        for(;l2+rc<w&&s[l1][l2+rc]=='*';rc++)
                        {
                            //cout<<" checking "<<l1<<" "<<l2+rc<<endl;
                        }
                        if(rc>2)
                            ans++;
                        if(ans==2)
                        {
                            //cout<<"satisfies with dc "<<dc<<" and rc "<<rc<<endl;
                            f(0,x,dc)
                            {
                                //cout<<" changing "<<i+x<<" "<<j<<endl;
                                s[i+x][j]='.';
                            }
                            f(0,y,rc)
                            {
                                //cout<<" changing "<<l1<<" "<<l2+y<<endl;
                                s[l1][l2+y]='.';
                            }
                            flag=1;
                            //f(0,x,h)
                            //{
                                //f(0,y,w)
                                    //cout<<s[x][y];
                                //cout<<endl;
                            //}
                        }
                        else ans=0;
                    }
                }
            }
        if(flag==1)
            cout<<"YES";
        else
            cout<<"NO";
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll int64_t

#define pmax 1000000007
#define inf 1000000000000000000
#define alt 100002

#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second

#define f(x,y,z) for(ll y=x;y<z;y++)
#define fr(x,y,z) for(ll y=z-1;y>=x;y--)
#define fv(x,y) for(auto x=y.begin();x!=y.end();x++)
#define all(x) x.begin(),x.end()
#define outv(x) for(auto i=x.begin();i!=x.end();i++) cout<<*i<<' '; cout<<endl;
#define outvll(x) for(auto i=x.begin();i!=x.end();i++)	cout<<*i.ff<<' '<<*i.ss<<'\t';	cout<<endl;

using namespace std;

/*
bool sv[alt];
void fillsv(ll x)
{
    memset(sv,true,sizeof(sv));
    sv[0]=sv[1]=false;
    for(ll p=2;p*p<=x;p++)
        if(sv[p]==true)
            for(ll i=p*p;i<=x;i+=p)
                sv[i]=false;
}
*/

inline ll max(ll a,ll b)
{
    return (a>b)?a:b;
}

inline ll min(ll a,ll b)
{
    return (a<b)?a:b;
}

inline ll max3(ll a,ll b,ll c)
{
    return max(a,max(b,c));
}

inline ll min3(ll a,ll b,ll c)
{
    return min(a,min(b,c));
}

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

ll pow3(ll a,ll b, ll m=pmax)
{
    ll res=1;
    while(b>0)
    {
        if(b&1)
            res=(res*a)%m;
        a=(a*a)%m;
        b>>=1;
    }
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //fillsv(alt);
    ll t=1;
    //cin>>t;
    while(t--)
    {
        ll w,h;
        cin>>h>>w;
        string s[h];
        f(0,i,h)
            cin>>s[i];
        ll ans=0,flag=0,fa=0;
        //f(0,x,h)
        //{
            //f(0,y,w)
                //cout<<s[x][y];
            //cout<<endl;
        //}
        f(0,i,h)
            f(0,j,w)
            {
                //cout<<"position "<<i<<" "<<j<<endl;
                if(s[i][j]=='*')
                {
                    if(flag==1)
                    {
                        cout<<"NO";
                        return 0;
                    }
                    else
                    {
                        ll dc=0,dc1=0,rc=0,rc1=0;
                        for(;i+dc<h&&s[i+dc][j]=='*';dc++)
                        {
                            //cout<<" checking "<<i+dc<<" "<<j<<endl;
                        }
                        for(;i-dc1<h&&i-dc1>=0&&s[i-dc1][j]=='*';dc1++)
                        {
                            //cout<<" checking "<<i-dc1<<" "<<j<<endl;
                        }
                        if(dc+dc1>=4)
                            ans++;
                        for(;i<h&&j+rc>0&&j+rc<w&&s[i][j+rc]=='*';rc++)
                        {
                            //cout<<" checking "<<i<<" "<<j+rc<<endl;
                        }
                        for(;i<h&&j-rc1>=0&&j-rc1<w&&s[i][j-rc1]=='*';rc1++)
                        {
                            //cout<<" checking "<<i<<" "<<j-rc1<<endl;
                        }
                        if(rc+rc1>=4)
                            ans++;
                        //cout<<" ans= "<<ans<<endl;
                        if(ans==2)
                        {
                            //cout<<" satisfies"<<endl;
                            f(0,x,dc)
                            {
                                //cout<<" changing "<<i+x<<" "<<j<<endl;
                                s[i+x][j]='.';
                            }
                            f(0,x,dc1)
                            {
                                //cout<<" changing "<<i-x<<" "<<j<<endl;
                                s[i-x][j]='.';
                            }
                            f(0,y,rc)
                            {
                                //cout<<" changing "<<i<<" "<<j+y<<endl;
                                s[i][j+y]='.';
                            }
                            f(0,y,rc1)
                            {
                                //cout<<" changing "<<i<<" "<<j-y<<endl;
                                s[i][j-y]='.';
                            }
                            flag=1;
                            fa=0;
                            i=0;
                            j=0;
                            //f(0,x,h)
                            //{
                                //f(0,y,w)
                                    //cout<<s[x][y];
                                //cout<<endl;
                            //}
                        }
                        else
                        {
                            fa=1;
                            ans=0;
                        }
                    }
                }
            }
        if(flag==1&&fa==0)
            cout<<"YES";
        else
            cout<<"NO";
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll int64_t

#define pmax 1000000007
#define inf 1000000000000000000
#define alt 100002

#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second

#define f(x,y,z) for(ll y=x;y<z;y++)
#define fr(x,y,z) for(ll y=z-1;y>=x;y--)
#define fv(x,y) for(auto x=y.begin();x!=y.end();x++)
#define all(x) x.begin(),x.end()
#define outv(x) for(auto i=x.begin();i!=x.end();i++) cout<<*i<<' '; cout<<endl;
#define outvll(x) for(auto i=x.begin();i!=x.end();i++)	cout<<*i.ff<<' '<<*i.ss<<'\t';	cout<<endl;

using namespace std;

/*
bool sv[alt];
void fillsv(ll x)
{
    memset(sv,true,sizeof(sv));
    sv[0]=sv[1]=false;
    for(ll p=2;p*p<=x;p++)
        if(sv[p]==true)
            for(ll i=p*p;i<=x;i+=p)
                sv[i]=false;
}
*/

inline ll max(ll a,ll b)
{
    return (a>b)?a:b;
}

inline ll min(ll a,ll b)
{
    return (a<b)?a:b;
}

inline ll max3(ll a,ll b,ll c)
{
    return max(a,max(b,c));
}

inline ll min3(ll a,ll b,ll c)
{
    return min(a,min(b,c));
}

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

ll pow3(ll a,ll b, ll m=pmax)
{
    ll res=1;
    while(b>0)
    {
        if(b&1)
            res=(res*a)%m;
        a=(a*a)%m;
        b>>=1;
    }
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //fillsv(alt);
    ll t=1;
    //cin>>t;
    while(t--)
    {
        ll w,h;
        cin>>h>>w;
        string s[h];
        f(0,i,h)
            cin>>s[i];
        ll ans=0,flag=0,fa=0;
        //f(0,x,h)
        //{
            //f(0,y,w)
                //cout<<s[x][y];
            //cout<<endl;
        //}
        f(0,i,h)
            f(0,j,w)
            {
                //cout<<"position "<<i<<" "<<j<<endl;
                if(s[i][j]=='*')
                {
                    if(flag==1)
                    {
                        cout<<"NO";
                        return 0;
                    }
                    else
                    {
                        ll dc=0,l1=i+1,l2=j-1,rc=0;
                        for(;i+dc<h&&s[i+dc][j]=='*';dc++)
                        {
                            //cout<<" checking "<<l1<<" "<<l2+rc<<endl;
                        }
                        if(dc>2)
                            ans++;
                        for(;l1<h&&l2+rc>0&&l2+rc<w&&s[l1][l2+rc]=='*';rc++)
                        {
                            //cout<<" checking "<<l1<<" "<<l2+rc<<endl;
                        }
                        if(rc>2)
                            ans++;
                        if(ans==2)
                        {
                            //cout<<"satisfies with dc "<<dc<<" and rc "<<rc<<endl;
                            f(0,x,dc)
                            {
                                //cout<<" changing "<<i+x<<" "<<j<<endl;
                                s[i+x][j]='.';
                            }
                            f(0,y,rc)
                            {
                                //cout<<" changing "<<l1<<" "<<l2+y<<endl;
                                s[l1][l2+y]='.';
                            }
                            flag=1;
                            //f(0,x,h)
                            //{
                                //f(0,y,w)
                                    //cout<<s[x][y];
                                //cout<<endl;
                            //}
                        }
                        else
                        {
                            fa=1;
                            ans=0;
                        }
                    }
                }
            }
        if(flag==1&&fa==0)
            cout<<"YES";
        else
            cout<<"NO";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
   int h,w,count1=0;
   cin>>h>>w;
   string str[h];
   for(int i=0; i<h; i++)
   {
       cin>>str[i];
   }
   for(int i=0; i<h-1; i++)
   {
       for(int j=0; j<w-1; j++)
       {
           if(str[i][j]=='*' && str[i+1][j]=='*' && str[i][j+1]=='*' && str[i-1][j]=='*' && str[i][j-1]=='*')
           {
               if(count1==1){
                    cout<<"NO";
                    return 0;
               }
               count1++;
               int upper=i;
               int down=i+1;
               int left=j-1;
               int right=j+1;
               while(upper>=0 && str[upper][j]=='*')str[upper--][j]='.';
               while(down<h && str[down][j]=='*')str[down++][j]='.';
               while(left>=0 && str[i][left]=='*')str[i][left--]='.';
               while(right<w && str[i][right]=='*')str[i][right++]='.';
               for(int m=0; m<h; m++)
               {
                   for(int n=0; n<w; n++)
                   {
                       if(str[m][n]=='*')
                       {
                            cout<<"NO";
                           return 0;
                       }
                   }
               }
               cout<<"YES";
               return 0;
           }
       }
   }
   cout<<"NO";
   return 0;
}


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

const int N = 505;
char s[N][N];
int n, m;
int cntR[N], cntC[N];

string solve() {
    for (int i=0; i<n; i++) {
        for (int j=0; j<m; j++) {
            if (s[i][j] == '*') {
                cntR[i] ++;
                cntC[j] ++;
            }
        }
    }
    int row_idx = -1, row_val = 0;
    for (int i=0; i<n; i++)
        if (row_val < cntR[i]) {
            row_val = cntR[i];
            row_idx = i;
        }
    int col_idx = -1, col_val = 0;
    for (int i=0; i<m; i++)
        if (col_val < cntC[i]) {
            col_val = cntC[i];
            col_idx = i;
        }
    if (row_idx == -1 || col_idx == -1)
        return "NO";
    int i, j;
    i = row_idx+1, j = col_idx;
    while (i < n && s[i][j] == '*') {
        s[i][j] = '.';
        i++;
    }
    i = row_idx-1, j = col_idx;
    while (i >= 0 && s[i][j] == '*') {
        s[i][j] = '.';
        i--;
    }
    i = row_idx, j = col_idx+1;
    while (j < m && s[i][j] == '*') {
        s[i][j] = '.';
        j++;
    }
    i = row_idx, j = col_idx-1;
    while (j >= 0 && s[i][j] == '*') {
        s[i][j] = '.';
        j--;
    }
    if (s[row_idx][col_idx] == '*')
        s[row_idx][col_idx] = '.';
    else
        return "NO";
    for (int i=0; i<n; i++)
        for (int j=0; j<m; j++)
            if (s[i][j] == '*')
                return "NO";
    return "YES";
}

int main() {
    cin >> n >> m;
    for (int i=0; i<n; i++)
        cin >> s[i];
    cout << solve();
}


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

const int N = 505;
char s[N][N];
int n, m;
int cntR[N], cntC[N];

string solve() {
    for (int i=0; i<n; i++) {
        for (int j=0; j<m; j++) {
            if (s[i][j] == '*') {
                cntR[i] ++;
                cntC[j] ++;
            }
        }
    }
    int row_idx = -1, row_val = 0;
    for (int i=0; i<n; i++)
        if (row_val < cntR[i]) {
            row_val = cntR[i];
            row_idx = i;
        }
    int col_idx = -1, col_val = 0;
    for (int i=0; i<m; i++)
        if (col_val < cntC[i]) {
            col_val = cntC[i];
            col_idx = i;
        }
    if (row_idx == -1 || col_idx == -1 || row_idx == col_idx)
        return "NO";
    int i, j;
    i = row_idx+1, j = col_idx;
    while (i < n && s[i][j] == '*') {
        s[i][j] = '.';
        i++;
    }
    i = row_idx-1, j = col_idx;
    while (i >= 0 && s[i][j] == '*') {
        s[i][j] = '.';
        i--;
    }
    i = row_idx, j = col_idx+1;
    while (j < m && s[i][j] == '*') {
        s[i][j] = '.';
        j++;
    }
    i = row_idx, j = col_idx-1;
    while (j >= 0 && s[i][j] == '*') {
        s[i][j] = '.';
        j--;
    }
    if (s[row_idx][col_idx] == '*')
        s[row_idx][col_idx] = '.';
    else
        return "NO";
    for (int i=0; i<n; i++)
        for (int j=0; j<m; j++)
            if (s[i][j] == '*')
                return "NO";
    return "YES";
}

int main() {
    cin >> n >> m;
    for (int i=0; i<n; i++)
        cin >> s[i];
    cout << solve();
}


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

const int N = 505;
char s[N][N];
int n, m;
int cntR[N], cntC[N];

string solve() {
    for (int i=0; i<n; i++) {
        for (int j=0; j<m; j++) {
            if (s[i][j] == '*') {
                cntR[i] ++;
                cntC[j] ++;
            }
        }
    }
    int row_idx = -1, row_val = 0;
    for (int i=0; i<n; i++)
        if (row_val < cntR[i]) {
            row_val = cntR[i];
            row_idx = i;
        }
    int col_idx = -1, col_val = 0;
    for (int i=0; i<m; i++)
        if (col_val < cntC[i]) {
            col_val = cntC[i];
            col_idx = i;
        }
    if (row_idx == -1 || col_idx == -1)
        return "NO";
    int i, j;
    i = row_idx+1, j = col_idx;
    while (i < n && s[i][j] == '*') i++;
    i = row_idx-1, j = col_idx;
    while (i >= 0 && s[i][j] == '*') i--;
    i = row_idx, j = col_idx+1;
    while (j < m && s[i][j] == '*') j++;
    i = row_idx, j = col_idx-1;
    while (j >= 0 && s[i][j] == '*') j--;
    if (s[row_idx][col_idx] == '*')
        s[row_idx][col_idx] = '.';
    else
        return "NO";
    for (int i=0; i<n; i++)
        for (int j=0; j<m; j++)
            if (s[i][j] == '*')
                return "NO";
    return "YES";
}

int main() {
    cin >> n >> m;
    for (int i=0; i<n; i++)
        cin >> s[i];
    cout << solve();
}


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

const int N = 505;
char s[N][N];
int n, m;
int cntR[N], cntC[N];

string solve() {
    for (int i=0; i<n; i++)
        for (int j=0; j<m; j++)
            if (s[i][j] == '*') {
                cntR[i] ++;
                cntC[j] ++;
            }
    int row_idx = -1, row_val = 0;
    for (int i=0; i<n; i++)
        if (row_val < cntR[i]) {
            row_val = cntR[i];
            row_idx = i;
        }
    int col_idx = -1, col_val = 0;
    for (int i=0; i<m; i++)
        if (col_val < cntC[i]) {
            col_val = cntC[i];
            col_idx = i;
        }
    if (row_idx == -1 || col_idx == -1)
        return "NO";
    // for (int i=0; i<n; i++) cout << cntR[i] << ' '; cout << '\n';
    // for (int i=0; i<m; i++) cout << cntC[i] << ' '; cout << '\n';
    for (int i=0; i<n; i++)
        if (i != row_idx && cntR[i] > 1)
            return "NO";
    for (int i=0; i<m; i++)
        if (i != col_idx && cntC[i] > 1)
            return "NO";
    int i=0;
    while (i < n && cntR[i] == 0) i++;
    while (i < n && cntR[i] > 0) i++;
    while (i < n && cntR[i] == 0) i++;
    if (i < n) return "NO";
    int j=0;
    while (j < m && cntC[j] == 0) j++;
    while (j < m && cntC[j] > 0) j++;
    while (j < m && cntC[j] == 0) j++;
    if (j < m) return "NO";
    return "YES";
}

int main() {
    cin >> n >> m;
    for (int i=0; i<n; i++)
        cin >> s[i];
    cout << solve();
}


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

const int N = 505;
char s[N][N];
int n, m;
int cntR[N], cntC[N];

string solve() {
    for (int i=0; i<n; i++) {
        for (int j=0; j<m; j++) {
            if (s[i][j] == '*') {
                cntR[i] ++;
                cntC[j] ++;
            }
        }
    }
    int row_idx = -1, row_val = 0;
    for (int i=0; i<n; i++)
        if (row_val < cntR[i]) {
            row_val = cntR[i];
            row_idx = i;
        }
    int col_idx = -1, col_val = 0;
    for (int i=0; i<m; i++)
        if (col_val < cntC[i]) {
            col_val = cntC[i];
            col_idx = i;
        }
    if (row_idx == -1 || col_idx == -1 || row_idx == 1 && col_idx == 1)
        return "NO";
    int i, j;
    i = row_idx+1, j = col_idx;
    while (i < n && s[i][j] == '*') {
        s[i][j] = '.';
        i++;
    }
    i = row_idx-1, j = col_idx;
    while (i >= 0 && s[i][j] == '*') {
        s[i][j] = '.';
        i--;
    }
    i = row_idx, j = col_idx+1;
    while (j < m && s[i][j] == '*') {
        s[i][j] = '.';
        j++;
    }
    i = row_idx, j = col_idx-1;
    while (j >= 0 && s[i][j] == '*') {
        s[i][j] = '.';
        j--;
    }
    if (s[row_idx][col_idx] == '*')
        s[row_idx][col_idx] = '.';
    else
        return "NO";
    for (int i=0; i<n; i++)
        for (int j=0; j<m; j++)
            if (s[i][j] == '*')
                return "NO";
    return "YES";
}

int main() {
    cin >> n >> m;
    for (int i=0; i<n; i++)
        cin >> s[i];
    cout << solve();
}


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

const int N = 505;
char s[N][N];
int n, m;
int cntR[N], cntC[N];

string solve() {
    for (int i=0; i<n; i++) {
        for (int j=0; j<m; j++) {
            if (s[i][j] == '*') {
                cntR[i] ++;
                cntC[j] ++;
            }
        }
    }
    int row_idx = -1, row_val = 0;
    for (int i=0; i<n; i++)
        if (row_val < cntR[i]) {
            row_val = cntR[i];
            row_idx = i;
        }
    int col_idx = -1, col_val = 0;
    for (int i=0; i<m; i++)
        if (col_val < cntC[i]) {
            col_val = cntC[i];
            col_idx = i;
        }
    if (row_idx == -1 || col_idx == -1)
        return "NO";
    int i, j;
    i = row_idx+1, j = col_idx;
    while (i < n && s[i][j] == '*') i++;
    i = row_idx-1, j = col_idx;
    while (i >= 0 && s[i][j] == '*') i--;
    i = row_idx, j = col_idx+1;
    while (j < m && s[i][j] == '*') j++;
    i = row_idx, j = col_idx-1;
    while (j >= 0 && s[i][j] == '*') j--;
    if (s[row_idx][col_idx] == '*')
        s[row_idx][col_idx] = '.';
    else
        return "NO";
    for (int i=0; i<n; i++)
        for (int i=0; i<n; i++)
            if (s[i][j] == '*')
                return "NO";
    return "YES";
}

int main() {
    cin >> n >> m;
    for (int i=0; i<n; i++)
        cin >> s[i];
    cout << solve();
}


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

const int N = 505;
char s[N][N];
int n, m;
int cntR[N], cntC[N];

string solve() {
    for (int i=0; i<n; i++)
        for (int j=0; j<m; j++)
            if (s[i][j] == '*') {
                cntR[i] ++;
                cntC[j] ++;
            }
    int row_idx = -1, row_val = 0;
    for (int i=0; i<n; i++)
        if (row_val < cntR[i]) {
            row_val = cntR[i];
            row_idx = i;
        }
    int col_idx = -1, col_val = 0;
    for (int i=0; i<m; i++)
        if (col_val < cntC[i]) {
            col_val = cntC[i];
            col_idx = i;
        }
    if (row_idx == -1 || col_idx == -1)
        return "NO";
    // for (int i=0; i<n; i++) cout << cntR[i] << ' '; cout << '\n';
    // for (int i=0; i<m; i++) cout << cntC[i] << ' '; cout << '\n';
    for (int i=0; i<n; i++)
        if (i != row_idx && cntR[i] > 1)
            return "NO";
    for (int i=0; i<m; i++)
        if (i != col_idx && cntC[i] > 1)
            return "NO";
    int s_row = 0, e_row = n-1;
    int i=0;
    while (i < n && cntR[i] == 0) i++;
    s_row = i;
    while (i < n && cntR[i] > 0) i++;
    e_row = i;
    while (i < n && cntR[i] == 0) i++;
    if (i < n) return "NO";
    int s_col = 0, e_col = m-1;
    int j=0;
    while (j < m && cntC[j] == 0) j++;
    s_col = j;
    while (j < m && cntC[j] > 0) j++;
    e_col = j;
    while (j < m && cntC[j] == 0) j++;
    if (j < m) return "NO";
    // cout << s_row << ' ' << e_row << ' ' << s_col << ' ' << e_col << '\n';
    for (int j=s_col; j<e_col; j++)
        if (s[row_idx][j] == '.')
           return "NO";
    for (int i=s_row; i<e_row; i++)
        if (s[i][col_idx] == '.')
            return "NO";
    if (!(row_idx > s_row && row_idx < e_row-1)) return "NO";
    if (!(col_idx > s_col && col_idx < e_col-1)) return "NO";
    return "YES";
}

int main() {
    cin >> n >> m;
    for (int i=0; i<n; i++)
        cin >> s[i];
    cout << solve();
}


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

const int N = 505;
char s[N][N];
int n, m;
int cntR[N], cntC[N];

string solve() {
    for (int i=0; i<n; i++)
        for (int j=0; j<m; j++)
            if (s[i][j] == '*') {
                cntR[i] ++;
                cntC[j] ++;
            }
    int row_idx = -1, row_val = 0;
    for (int i=0; i<n; i++)
        if (row_val < cntR[i]) {
            row_val = cntR[i];
            row_idx = i;
        }
    int col_idx = -1, col_val = 0;
    for (int i=0; i<m; i++)
        if (col_val < cntC[i]) {
            col_val = cntC[i];
            col_idx = i;
        }
    if (row_idx == -1 || col_idx == -1)
        return "NO";
    // for (int i=0; i<n; i++) cout << cntR[i] << ' '; cout << '\n';
    // for (int i=0; i<m; i++) cout << cntC[i] << ' '; cout << '\n';
    for (int i=0; i<n; i++)
        if (i != row_idx && cntR[i] > 1)
            return "NO";
    for (int i=0; i<m; i++)
        if (i != col_idx && cntC[i] > 1)
            return "NO";
    int s_row = 0, e_row = n-1;
    int i=0;
    while (i < n && cntR[i] == 0) i++;
    s_row = i;
    while (i < n && cntR[i] > 0) i++;
    e_row = i;
    while (i < n && cntR[i] == 0) i++;
    if (i < n) return "NO";
    int s_col = 0, e_col = m-1;
    int j=0;
    while (j < m && cntC[j] == 0) j++;
    s_col = j;
    while (j < m && cntC[j] > 0) j++;
    e_col = j;
    while (j < m && cntC[j] == 0) j++;
    if (j < m) return "NO";
    // cout << s_row << ' ' << e_row << ' ' << s_col << ' ' << e_col << '\n';
    for (int j=s_col; j<e_col; j++)
        if (s[row_idx][j] == '.')
           return "NO";
    for (int i=s_row; i<e_row; i++)
        if (s[i][col_idx] == '.')
            return "NO";
    return "YES";
}

int main() {
    cin >> n >> m;
    for (int i=0; i<n; i++)
        cin >> s[i];
    cout << solve();
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define pb push_back
vector < int > graph[200005];
int level[200005];
int highlevel = LONG_LONG_MIN;
map < int , vector < int > > levelmems ;
map < int , int > really;
map < int , int > inreally;
int bfs(int source)
{
    if(level[source] == -1)
    level[source] = 0;
    levelmems[0].pb(source);
    if(level[source] > highlevel)
    highlevel = level[source];
    queue < int > q;
    q.push(source);
    while(!q.empty())
    {
        int parent = q.front();
        for(auto it = graph[parent].begin()  ;it != graph[parent].end() ; it ++)
        {
            if(level[*it]== -1)
            {
                level[*it] = level[parent] + 1 ;
                levelmems[level[*it]].pb((*it));
                if(level[*it] > highlevel)
                highlevel = level[*it];
                q.push(*it);
            }
        }
        q.pop();
    }
}
signed main()
{
    int h , w ;
    cin >> h >> w;
    string s[h];
    map < pair < int , int > , int > safe;
    for(int x = 0 ; x<= h - 1  ;x ++)
    {
        cin >> s[x];
    }
    int count = 0 ;
    for(int x = 0 ; x<= h -1  ;x ++)
    {
        for(int y = 0 ; y <= s[x].length() - 1 ; y++)
        {
            if(count == 1 && s[x][y] == '*' && safe[{x,y}] != 1)
            {
                count = 0 ;
                break;
            }
            if(s[x][y] != '*' || x == 0 || x == h - 1 || y == 0 || y == s[x].length() - 1 )
            continue;
            char c = s[x][y];
            char u = s[x-1][y];
            char d = s[x+1][y];
            char l = s[x][y-1];
            char r = s[x][y+1];
            if(l == '*' && r == '*' && u == '*' && d == '*')
            {
                count++;
                for(int z = x ; z <= h-1  ; z ++)
                {
                    if(s[z][y] == '*')
                    safe[{z,y}] = 1;
                    else
                    break;
                }
                for(int z = x ; z >= 0  ; z --)
                {
                    if(s[z][y] == '*')
                    safe[{z,y}] = 1;
                    else
                    break;
                }
                for(int z = y ; z <= s[x].length()-1  ; z ++)
                {
                    if(s[x][z] == '*')
                    safe[{x,z}] = 1;
                    else
                    break;
                }
                for(int z = y ; z >= 0  ; z --)
                {
                    if(s[x][z] == '*')
                    safe[{x,z}] = 1;
                    else
                    break;
                }
            }
        }
    }
    if(count == 1)
    cout<<"YES\n";
    else
    cout<<"NO\n";
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
#define F first
#define S second
const int inf = 0x3f3f3f3f;
const int ms = 100100;

string query(ll l, ll r){
	string res;
	cout << l << " " << r << endl;
	cin >> res;
	return res;
}

int main(){
	srand(time(NULL));
	ll n, k;
	cin >> n >> k;
	ii atual = {1, n};
	string ans;
	while(1){
		if(atual.S-atual.F+1 == 2*k+1){
			ll pos = atual.F;
			ll add = rand()%(atual.S-atual.F+1);
			pos += add;
			ans = query(pos, pos);
			if(ans[0] == 'Y' || ans[0] == 'B'){
				return 0;
			}

			atual = {max(1LL, atual.F-k+1), min(n, atual.S+k)};
			continue;
		}

 		ll mid = (atual.F + atual.S)/2;
		ans = query(atual.F, mid);
		if(ans[0] == 'B')
			return 0;
		else if(ans[0] == 'Y'){
			atual = {max(1LL, atual.F-k), min(n, mid+k)};
			continue;
		}

		ans = query(mid+1, atual.S);
		if(ans[0] == 'B')
			return 0;
		else if(ans[0] == 'Y'){
			atual = {max(1LL, mid+1-k), min(n, atual.S+k)};
		}
		else{
			atual = {max(1LL, mid-2*k+1), min(n, mid+k)};
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
#define F first
#define S second
const int inf = 0x3f3f3f3f;
const int ms = 100100;

string query(ll l, ll r){
	string res;
	cout << l << " " << r << endl;
	cin >> res;
	return res;
}

int main(){
	srand(time(NULL));
	ll n, k;
	cin >> n >> k;
	ii atual = {1, n};
	string ans;
	while(1){
		if(atual.S-atual.F+1 <= 10){
			ll add = (rand())%(atual.S-atual.F+1);
			ll pos = atual.F+add;
			ans = query(pos, pos);
			if(ans[0] == 'Y' || ans[0] == 'B'){
				return 0;
			}

			atual = {max(1LL, atual.F-k), min(n, atual.S+k)};
			continue;
		}

 		ll mid = (atual.F + atual.S)/2;
		ans = query(atual.F, mid);
		if(ans[0] == 'B')
			return 0;
		else if(ans[0] == 'Y'){
			atual = {max(1LL, atual.F-k), min(n, mid+k)};
			continue;
		}

		ans = query(mid+1, atual.S);
		if(ans[0] == 'B')
			return 0;
		else if(ans[0] == 'Y'){
			atual = {max(1LL, mid+1-k), min(n, atual.S+k)};
		}
		else{
			atual = {max(1LL, mid-2*k), min(n, mid+k)};
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
#define F first
#define S second
const int inf = 0x3f3f3f3f;
const int ms = 100100;

string query(ll l, ll r){
	string res;
	cout << l << " " << r << endl;
	cin >> res;
	return res;
}

int main(){
	srand(time(NULL));
	ll n, k;
	cin >> n >> k;
	ii atual = {1, n};
	string ans;
	//set<ll> chutes;
	while(1){
		if(atual.S-atual.F+1 <= 3*k){
			ll add = (rand())%(atual.S-atual.F+1);
			add = (add<<16)%(atual.S-atual.F+1);

			ll pos = atual.F+add;
			ans = query(pos, pos);
			if(ans[0] == 'Y' || ans[0] == 'B'){
				return 0;
			}

			atual = {max(1LL, atual.F-k), min(n, atual.S+k)};
		}

 		ll mid = (atual.F + atual.S)/2;
		ans = query(atual.F, mid);
		if(ans[0] == 'B')
			return 0;
		else if(ans[0] == 'Y'){
			atual = {max(1LL, atual.F-k), min(n, mid+k)};
			continue;
		}

		ans = query(mid+1, atual.S);
		if(ans[0] == 'B')
			return 0;
		else if(ans[0] == 'Y'){
			atual = {max(1LL, mid+1-k), min(n, atual.S+k)};
		}
		else{
			atual = {max(1LL, mid-2*k), min(n, mid+k)};
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
#define F first
#define S second
const int inf = 0x3f3f3f3f;
const int ms = 100100;

string query(ll l, ll r){
	string res;
	cout << l << " " << r << endl;
	cin >> res;
	return res;
}

int main(){
	srand(time(NULL));
	ll n, k;
	cin >> n >> k;
	ii atual = {1, n};
	string ans;
	while(1){
		if(atual.S-atual.F+1 <= 50){
			ll add = (rand())%(atual.S-atual.F+1);
			ll pos = atual.F+add;
			ans = query(pos, pos);
			if(ans[0] == 'Y' || ans[0] == 'B'){
				return 0;
			}

			atual = {max(1LL, atual.F-k), min(n, atual.S+k)};
			continue;
		}

 		ll mid = (atual.F + atual.S)/2;
		ans = query(atual.F, mid);
		if(ans[0] == 'B')
			return 0;
		else if(ans[0] == 'Y'){
			atual = {max(1LL, atual.F-k), min(n, mid+k)};
			continue;
		}

		ans = query(mid+1, atual.S);
		if(ans[0] == 'B')
			return 0;
		else if(ans[0] == 'Y'){
			atual = {max(1LL, mid+1-k), min(n, atual.S+k)};
		}
		else{
			atual = {max(1LL, mid-2*k), min(n, mid+k)};
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
#define F first
#define S second
const int inf = 0x3f3f3f3f;
const int ms = 100100;

string query(ll l, ll r){
	string res;
	cout << l << " " << r << endl;
	cin >> res;
	return res;
}

int main(){
	srand(time(NULL));
	ll n, k;
	cin >> n >> k;
	ii atual = {1, n};
	string ans;
	while(1){
		if(atual.S-atual.F+1 < k){
			ll pos = atual.F;
			ll add = rand()%(atual.S-atual.F+1);
			pos += add;
			ans = query(pos, pos);
			if(ans[0] == 'Y' || ans[0] == 'B'){
				return 0;
			}

			atual = {max(1LL, atual.F-k+1), min(n, atual.S+k)};
			continue;
		}

 		ll mid = (atual.F + atual.S)/2;
		ans = query(atual.F, mid);
		if(ans[0] == 'B')
			return 0;
		else if(ans[0] == 'Y'){
			atual = {max(1LL, atual.F-k), min(n, mid+k)};
			continue;
		}

		ans = query(mid+1, atual.S);
		if(ans[0] == 'B')
			return 0;
		else if(ans[0] == 'Y'){
			atual = {max(1LL, mid+1-k), min(n, atual.S+k)};
		}
		else{
			atual = {max(1LL, mid-2*k+1), min(n, mid+k)};
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
#define F first
#define S second
const int inf = 0x3f3f3f3f;
const int ms = 100100;

string query(ll l, ll r){
	string res;
	cout << l << " " << r << endl;
	cin >> res;
	return res;
}

int main(){
	srand(time(NULL));
	ll n, k;
	cin >> n >> k;
	ii atual = {1, n};
	string ans;
	set<ll> chutes;
	while(1){
		if(atual.S-atual.F+1 <= 3*k){
			ll add = (rand())%(atual.S-atual.F+1);
			add = (add<<16)%(atual.S-atual.F+1);

			while(chutes.count(atual.F+add)){
				add = (rand())%(atual.S-atual.F+1);
				add = (add<<16)%(atual.S-atual.F+1);
			}

			ll pos = atual.F+add;
			chutes.insert(pos);
			ans = query(pos, pos);
			if(ans[0] == 'Y' || ans[0] == 'B'){
				return 0;
			}

			atual = {max(1LL, atual.F-k), min(n, atual.S+k)};
		}

 		ll mid = (atual.F + atual.S)/2;
		ans = query(atual.F, mid);
		if(ans[0] == 'B')
			return 0;
		else if(ans[0] == 'Y'){
			atual = {max(1LL, atual.F-k), min(n, mid+k)};
			continue;
		}

		ans = query(mid+1, atual.S);
		if(ans[0] == 'B')
			return 0;
		else if(ans[0] == 'Y'){
			atual = {max(1LL, mid+1-k), min(n, atual.S+k)};
		}
		else{
			atual = {max(1LL, mid-2*k), min(n, mid+k)};
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
#define F first
#define S second
const int inf = 0x3f3f3f3f;
const int ms = 100100;

string query(ll l, ll r){
	string res;
	cout << l << " " << r << endl;
	cin >> res;
	return res;
}

int main(){
	srand(time(NULL));
	ll n, k;
	cin >> n >> k;
	ii atual = {1, n};
	string ans;
	while(1){
		if(atual.S-atual.F+1 <= 2*k){
			ll pos = atual.F;
			ll add = rand()%(atual.S-atual.F+1);
			pos += add;
			ans = query(pos, pos);
			if(ans[0] == 'Y' || ans[0] == 'B'){
				return 0;
			}

			atual = {max(1LL, atual.F-k), min(n, atual.S+k)};
			continue;
		}

 		ll mid = (atual.F + atual.S)/2;
		ans = query(atual.F, mid);
		if(ans[0] == 'B')
			return 0;
		else if(ans[0] == 'Y'){
			atual = {max(1LL, atual.F-k), min(n, mid+k)};
			continue;
		}

		ans = query(mid+1, atual.S);
		if(ans[0] == 'B')
			return 0;
		else if(ans[0] == 'Y'){
			atual = {max(1LL, mid+1-k), min(n, atual.S+k)};
		}
		else{
			atual = {max(1LL, mid-2*k+1), min(n, mid+k)};
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k, p, l = 1, r;
inline bool query(ll l,ll r)
{
	cout<<l<<" "<<r<<endl;
	fflush(stdout);
	char t[5];
	cin>>t;
	if(t[0]=='Y'&&l==r)exit(0);
	return t[0]=='Y';
}
inline ll shk(ll num) {return max(1LL, num - k);}
inline ll epd(ll num) {return min(n, num + k);}
int main(){
    scanf("%lld%lld", &n, &k);
    mt19937 rng(time(NULL));
    l = 1, r = n;
    while(1){
        // printf("Current l = %lld, r = %lld\n", l, r);
        while(r - l > 60LL){
            // printf("BS: Current l = %lld, r = %lld\n", l, r);
            ll mid = (r + l) >> 1;
            bool reply = query(mid, r);
            if(reply) {  l = shk(mid), r = epd(r); }
            else { l = shk(l), r = epd(mid-1);}
        }
        ll ask = l + rng() % (r - l + 1);
        if(query(ask, ask)) return 0;
        l = shk(l), r = epd(r);
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k, p, l = 1, r;
inline bool query(int lb, int rb){
    printf("%d %d\n", lb, rb);
    fflush(stdout);
    string rep; cin >> rep;
    if(rep == "Yes" && lb == rb) exit(0);
    return rep == "Yes";
}
inline ll shk(ll num) {return max(1LL, num - k);}
inline ll epd(ll num) {return min(n, num + k);}
int main(){
    scanf("%lld%lld", &n, &k);
    mt19937 rng(time(NULL));
    srand(time(0));
    l = 1, r = n;
    while(1){
        // printf("Current l = %lld, r = %lld\n", l, r);
        // while(r - l > 60LL){
        //     // printf("BS: Current l = %lld, r = %lld\n", l, r);
        //     mid = (r + l) >> 1;
        //     bool reply = query(mid, r);
        //     if(reply) {  l = shk(mid), r = epd(r); }
        //     else { l = shk(l), r = epd(mid-1);}
        // }

		while(r - l > 50)
		{
			ll mid = (l + r) >> 1;
			if(query(l, mid)) r = mid;
			else l = mid + 1;
            l = shk(l), r = epd(r);
		}
        ll ask = l + rand() % (r - l + 1);
        if(query(ask, ask)) return 0;
        l = shk(l), r = epd(r);
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k, p, l = 1, r;
inline bool query(int lb, int rb){
    printf("%d %d\n", lb, rb);
    fflush(stdout);
    string rep; cin >> rep;
    if(rep == "Bad") exit(0);
    return rep == "Yes";
}
inline ll shk(ll num) {return max(1LL, num - k);}
inline ll epd(ll num) {return min(n, num + k);}
int main(){
    scanf("%lld%lld", &n, &k);
    mt19937 rng(time(NULL));
    srand(time(0));
    l = 1, r = n;
    while(1){
        // printf("Current l = %lld, r = %lld\n", l, r);
        // while(r - l > 60LL){
        //     // printf("BS: Current l = %lld, r = %lld\n", l, r);
        //     mid = (r + l) >> 1;
        //     bool reply = query(mid, r);
        //     if(reply) {  l = shk(mid), r = epd(r); }
        //     else { l = shk(l), r = epd(mid-1);}
        // }

		while(r - l > 50)
		{
			ll mid = (l + r) >> 1;
			if(query(l, mid)) r = mid;
			else l = mid + 1;
			l-=k,r+=k;
			l=max(l,1ll),r=min(r,n);
		}
        ll ask = l + rand() % (r - l + 1);
        if(query(ask, ask)) return 0;
		l-=k,r+=k;
		l=max(l,1ll),r=min(r,n);
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k, p, l = 1, r, mid;
inline bool query(int lb, int rb){
    printf("%d %d\n", lb, rb);
    fflush(stdout);
    string rep; cin >> rep;
    if(rep == "Bad") exit(0);
    return rep == "Yes";
}
inline ll shk(ll num) {return max(1LL, num - k);}
inline ll epd(ll num) {return min(n, num + k);}
int main(){
    scanf("%lld%lld", &n, &k);
    mt19937_64 rng(time(NULL));
    r = n;
    while(1){
        // printf("Current l = %lld, r = %lld\n", l, r);
        while(r - l > 60LL){
            // printf("BS: Current l = %lld, r = %lld\n", l, r);
            mid = (r + l) >> 1;
            bool reply = query(mid, r);
            if(reply) {  l = shk(mid), r = epd(r); }
            else { l = shk(l), r = epd(mid-1);}
        }
        ll ask = l + rng() % (r - l + 1);
        if(query(ask, ask)) return 0;
        l = shk(l), r = epd(r);
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k, p, l = 1, r;
inline bool query(int lb, int rb){
    printf("%d %d\n", lb, rb);
    fflush(stdout);
    string rep; cin >> rep;
    if(rep == "Bad") exit(0);
    return rep == "Yes";
}
inline ll shk(ll num) {return max(1LL, num - k);}
inline ll epd(ll num) {return min(n, num + k);}
int main(){
    scanf("%lld%lld", &n, &k);
    mt19937 rng(time(NULL));
    l = 1, r = n;
    while(1){
        // printf("Current l = %lld, r = %lld\n", l, r);
        // while(r - l > 60LL){
        //     // printf("BS: Current l = %lld, r = %lld\n", l, r);
        //     mid = (r + l) >> 1;
        //     bool reply = query(mid, r);
        //     if(reply) {  l = shk(mid), r = epd(r); }
        //     else { l = shk(l), r = epd(mid-1);}
        // }

		while(r - l > 50)
		{
			ll mid = (l + r) >> 1;
			if(query(l, mid)) r = mid;
			else l = mid + 1;
            l = shk(l), r = epd(r);
		}
        ll ask = l + rand() % (r - l + 1);
        if(query(ask, ask)) return 0;
        l = shk(l), r = epd(r);
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k, p, l = 1, r;
inline bool query(int lb, int rb){
    printf("%d %d\n", lb, rb);
    fflush(stdout);
    string rep; cin >> rep;
    return rep[0] == 'Y';
}
inline ll shk(ll num) {return max(1LL, num - k);}
inline ll epd(ll num) {return min(n, num + k);}
int main(){
    scanf("%lld%lld", &n, &k);
    mt19937 rng(time(NULL));
    srand(time(0));
    l = 1, r = n;
    while(1){
        // printf("Current l = %lld, r = %lld\n", l, r);
        // while(r - l > 60LL){
        //     // printf("BS: Current l = %lld, r = %lld\n", l, r);
        //     mid = (r + l) >> 1;
        //     bool reply = query(mid, r);
        //     if(reply) {  l = shk(mid), r = epd(r); }
        //     else { l = shk(l), r = epd(mid-1);}
        // }

		while(r - l > 50)
		{
			ll mid = (l + r) >> 1;
			if(query(l, mid)) r = mid;
			else l = mid + 1;
            l = shk(l), r = epd(r);
		}
        ll ask = l + rand() % (r - l + 1);
        if(query(ask, ask)) return 0;
        l = shk(l), r = epd(r);
    }
}


// copied
#include<bits/stdc++.h>
# define ll long long
using namespace std;
inline bool qry(ll l,ll r)
{
	cout<<l<<" "<<r<<endl;
	fflush(stdout);
	char t[5];
	cin>>t;
	if(t[0]=='Y'&&l==r)exit(0);
	return t[0]=='Y';
}

int main()
{
	srand(time(0));
	ll n;int k;
	cin>>n>>k;
	ll l=1,r=n;
	while(1)
	{
		while(r-l>50)
		{
			ll mid=(l+r)>>1;
			if(qry(l,mid))r=mid;
			else l=mid+1;
			l-=k,r+=k;
			l=max(l,1ll),r=min(r,n);
		}
		ll p=rand()%(r-l+1)+l;
		qry(p,p);
		l-=k,r+=k;
		l=max(l,1ll),r=min(r,n);
	}
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k, p, l = 1, r, mid;
inline bool query(int lb, int rb){
    printf("%d %d\n", lb, rb);
    fflush(stdout);
    string rep; cin >> rep;
    return rep == "Yes";
}
inline ll shk(ll num) {return max(1LL, num - k);}
inline ll epd(ll num) {return min(n, num + k);}
int main(){
    scanf("%lld%lld", &n, &k);
    mt19937_64 rng(time(NULL));
    r = n;
    while(1){
        // printf("Current l = %lld, r = %lld\n", l, r);
        while(r - l > 60LL){
            // printf("BS: Current l = %lld, r = %lld\n", l, r);
            mid = (r + l) >> 1;
            bool reply = query(mid, r);
            if(reply) {  l = shk(mid), r = epd(r); }
            else { l = shk(l), r = epd(mid);}
        }
        ll ask = l + rng() % (r - l + 1);
        if(query(ask, ask)) return 0;
        l = shk(l), r = epd(r);
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k, p, l = 1, r;
inline bool query(ll l,ll r)
{
    printf("%d %d\n", l, r);
	fflush(stdout);
	char t[5];
	cin>>t;
	if(t[0]=='Y'&&l==r)exit(0);
	return t[0]=='Y';
}
inline ll shk(ll num) {return max(1LL, num - k);}
inline ll epd(ll num) {return min(n, num + k);}
int main(){
    scanf("%lld%lld", &n, &k);
    mt19937 rng(time(NULL));
    l = 1, r = n;
    while(1){
        while(r - l > 60LL){
            ll mid = (r + l) >> 1;
            bool reply = query(mid, r);
            if(reply) {  l = shk(mid), r = epd(r); }
            else { l = shk(l), r = epd(mid-1);}
        }
        ll ask = l + rng() % (r - l + 1);
        if(query(ask, ask)) return 0;
        l = shk(l), r = epd(r);
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k, p, l = 1, r;
inline bool query(ll l,ll r)
{
	cout<<l<<" "<<r<<endl;
	fflush(stdout);
	char t[5];
	cin>>t;
	if(t[0]=='Y'&&l==r)exit(0);
	return t[0]=='Y';
}
inline ll shk(ll num) {return max(1LL, num - k);}
inline ll epd(ll num) {return min(n, num + k);}
int main(){
    scanf("%lld%lld", &n, &k);
    mt19937 rng(time(NULL));
    srand(time(0));
    l = 1, r = n;
    while(1){
        // printf("Current l = %lld, r = %lld\n", l, r);
        // while(r - l > 60LL){
        //     // printf("BS: Current l = %lld, r = %lld\n", l, r);
        //     mid = (r + l) >> 1;
        //     bool reply = query(mid, r);
        //     if(reply) {  l = shk(mid), r = epd(r); }
        //     else { l = shk(l), r = epd(mid-1);}
        // }

		while(r - l > 50)
		{
			ll mid = (l + r) >> 1;
			if(query(l, mid)) r = mid;
			else l = mid + 1;
            l = shk(l), r = epd(r);
		}
        ll ask = l + rand() % (r - l + 1);
        if(query(ask, ask)) return 0;
        l = shk(l), r = epd(r);
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k, p, l = 1, r, mid;
inline bool query(int lb, int rb){
    printf("%d %d\n", lb, rb);
    fflush(stdout);
    string rep; cin >> rep;
    return rep == "Yes";
}
inline ll shk(ll num) {return max(1LL, num - k);}
inline ll epd(ll num) {return min(n, num + k);}
int main(){
    scanf("%lld%lld", &n, &k);
    mt19937_64 rng(time(NULL));
    r = n;
    while(1){
        // printf("Current l = %lld, r = %lld\n", l, r);
        while(r - l > 42LL){
            // printf("BS: Current l = %lld, r = %lld\n", l, r);
            mid = (r + l) >> 1;
            bool reply = query(mid, r);
            if(reply) {  l = shk(mid), r = epd(r); }
            else { l = shk(l), r = epd(mid);}
        }
        ll ask = l + rng() % (r - l + 1);
        if(query(ask, ask)) return 0;
        l = shk(l), r = epd(r);
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k, p, l = 1, r;
inline bool query(int lb, int rb){
    printf("%lld %lld\n", lb, rb);
    fflush(stdout);
    string rep; cin >> rep;
    if(rep == "Yes" && lb == rb) exit(0);
    return rep == "Yes";
}
inline ll shk(ll num) {return max(1LL, num - k);}
inline ll epd(ll num) {return min(n, num + k);}
int main(){
    scanf("%lld%lld", &n, &k);
    mt19937 rng(time(NULL));
    srand(time(0));
    l = 1, r = n;
    while(1){
        // printf("Current l = %lld, r = %lld\n", l, r);
        while(r - l > 60LL){
            // printf("BS: Current l = %lld, r = %lld\n", l, r);
            ll mid = (r + l) >> 1;
            bool reply = query(mid, r);
            if(reply) {  l = shk(mid), r = epd(r); }
            else { l = shk(l), r = epd(mid-1);}
        }
        ll ask = l + rand() % (r - l + 1);
        if(query(ask, ask)) return 0;
        l = shk(l), r = epd(r);
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k, p, l = 1, r;
inline bool query(int lb, int rb){
    printf("%d %d\n", lb, rb);
    fflush(stdout);
    string rep; cin >> rep;
    if(rep == "Bad") exit(0);
    return rep == "Yes";
}
inline ll shk(ll num) {return max(1LL, num - k);}
inline ll epd(ll num) {return min(n, num + k);}
int main(){
    scanf("%lld%lld", &n, &k);
    mt19937 rng(time(NULL));
    l = 1, r = n;
    while(1){
        // printf("Current l = %lld, r = %lld\n", l, r);
        // while(r - l > 60LL){
        //     // printf("BS: Current l = %lld, r = %lld\n", l, r);
        //     mid = (r + l) >> 1;
        //     bool reply = query(mid, r);
        //     if(reply) {  l = shk(mid), r = epd(r); }
        //     else { l = shk(l), r = epd(mid-1);}
        // }

		while(r - l > 50)
		{
			ll mid = (l + r) >> 1;
			if(query(l, mid)) r = mid;
			else l = mid + 1;
            l = shk(l), r = epd(r);
		}
        ll ask = l + rng() % (r - l + 1);
        if(query(ask, ask)) return 0;
        l = shk(l), r = epd(r);
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k, p, l = 1, r;
inline bool query(ll lb,ll rb)
{
    printf("%I64d %I64d\n", lb, rb);
	fflush(stdout);
	char t[5];
	cin>>t;
	if(t[0]== 'Y' && lb==rb) exit(0);
	return t[0]=='Y';
}
inline ll shk(ll num) {return max(1LL, num - k);}
inline ll epd(ll num) {return min(n, num + k);}
int main(){
    scanf("%lld%lld", &n, &k);
    mt19937 rng(time(NULL));
    l = 1, r = n;
    while(1){
        while(r - l > 60LL){
            ll mid = (r + l) >> 1;
            bool reply = query(mid, r);
            if(reply) {  l = shk(mid), r = epd(r); }
            else { l = shk(l), r = epd(mid-1);}
        }
        ll ask = l + rng() % (r - l + 1);
        if(query(ask, ask)) return 0;
        l = shk(l), r = epd(r);
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k, p, l = 1, r;
inline bool query(int lb, int rb){
    printf("%d %d\n", lb, rb);
    fflush(stdout);
    string rep; cin >> rep;
    if(rep[0] == 'Y' && lb == rb) exit(0);
    return rep[0] == 'Y';
}
inline ll shk(ll num) {return max(1LL, num - k);}
inline ll epd(ll num) {return min(n, num + k);}
int main(){
    scanf("%lld%lld", &n, &k);
    mt19937 rng(time(NULL));
    srand(time(0));
    l = 1, r = n;
    while(1){
        // printf("Current l = %lld, r = %lld\n", l, r);
        while(r - l > 60LL){
            // printf("BS: Current l = %lld, r = %lld\n", l, r);
            ll mid = (r + l) >> 1;
            bool reply = query(mid, r);
            if(reply) {  l = shk(mid), r = epd(r); }
            else { l = shk(l), r = epd(mid-1);}
        }
        ll ask = l + rand() % (r - l + 1);
        if(query(ask, ask)) return 0;
        l = shk(l), r = epd(r);
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k, p, l = 1, r;
inline bool query(int lb, int rb){
    printf("%d %d\n", lb, rb);
    fflush(stdout);
    string rep; cin >> rep;
    if(rep == "Bad") exit(0);
    return rep == "Yes";
}
inline ll shk(ll num) {return max(1LL, num - k);}
inline ll epd(ll num) {return min(n, num + k);}
int main(){
    scanf("%lld%lld", &n, &k);
    mt19937_64 rng(time(NULL));
    l = 1, r = n;
    while(1){
        // printf("Current l = %lld, r = %lld\n", l, r);
        // while(r - l > 60LL){
        //     // printf("BS: Current l = %lld, r = %lld\n", l, r);
        //     mid = (r + l) >> 1;
        //     bool reply = query(mid, r);
        //     if(reply) {  l = shk(mid), r = epd(r); }
        //     else { l = shk(l), r = epd(mid-1);}
        // }

		while(r - l > 50)
		{
			ll mid = (l + r) >> 1;
			if(query(l, mid)) r = mid;
			else l = mid + 1;
            l = shk(l), r = epd(r);
		}
        ll ask = l + rng() % (r - l + 1);
        if(query(ask, ask)) return 0;
        l = shk(l), r = epd(r);
    }
}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	loop:
	while(hi-lo>4*k+5){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Bad") return 0;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	int randomint = rand()%(hi+1-lo)+lo;
	cout<<randomint<<" "<<randomint<<endl;
	cin>>s;
	if (s=="Bad") return 0;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	srand(time(NULL));
	loop:
	while(hi-lo>4*k+150){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Bad") return 0;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	ll randomint = rand()%(hi+1-lo)+lo;
	cout<<randomint<<" "<<randomint<<endl;
	cin>>s;
	if (s=="Bad") return 0;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	srand(time(NULL));
	loop:
	while(hi-lo>4*k+2){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Bad") return 0;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	ll randomint = rand()%(hi+1-lo)+lo;
	cout<<randomint<<" "<<randomint<<endl;
	cin>>s;
	if (s=="Bad") return 0;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	srand(time(NULL));
	loop:
	while(hi-lo>4*k+21){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Bad") return 0;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	ll randomint = rand()%(hi+1-lo)+lo;
	cout<<randomint<<" "<<randomint<<endl;
	cin>>s;
	if (s=="Bad") return 0;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	srand(time(NULL));
	loop:
	while(hi-lo>4*k+10){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Bad") return 0;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	ll randomint = rand()%(hi+1-lo)+lo;
	cout<<randomint<<" "<<randomint<<endl;
	cin>>s;
	if (s=="Bad") return 0;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	loop:
	while(abs(hi-lo)>4*k+5){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	cout<<mid<<" "<<mid<<endl;
	cin>>s;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	loop:
	while(hi-lo>4*k+2){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Bad") return 0;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	int randomint = rand()%(hi+1-lo)+lo;
	cout<<randomint<<" "<<randomint<<endl;
	cin>>s;
	if (s=="Bad") return 0;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	srand(time(NULL));
	loop:
	while(hi-lo>4*k+6000){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Bad") return 0;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	ll randomint = rand()%(hi+1-lo)+lo;
	cout<<randomint<<" "<<randomint<<endl;
	cin>>s;
	if (s=="Bad") return 0;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	srand(time(NULL));
	loop:
	while(hi-lo>4*k+20){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Bad") return 0;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	int randomint = rand()%(hi+1-lo)+lo;
	cout<<randomint<<" "<<randomint<<endl;
	cin>>s;
	if (s=="Bad") return 0;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	srand(time(NULL));
	loop:
	while(hi-lo>4*k){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Bad") return 0;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	int randomint = rand()%(hi+1-lo)+lo;
	cout<<randomint<<" "<<randomint<<endl;
	cin>>s;
	if (s=="Bad") return 0;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	loop:
	while(abs(hi-lo)>4*k+5){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Bad") return 0;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	cout<<mid<<" "<<mid<<endl;
	cin>>s;
	if (s=="Bad") return 0;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	srand(time(NULL));
	loop:
	while(hi-lo>4*k+5){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Bad") return 0;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	ll randomint = rand()%(hi+1-lo)+lo;
	cout<<randomint<<" "<<randomint<<endl;
	cin>>s;
	if (s=="Bad") return 0;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	srand(time(NULL));
	loop:
	while(hi-lo>4*k+45){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Bad") return 0;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	ll randomint = rand()%(hi+1-lo)+lo;
	cout<<randomint<<" "<<randomint<<endl;
	cin>>s;
	if (s=="Bad") return 0;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	srand(time(NULL));
	loop:
	while(hi-lo>4*k+20){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Bad") return 0;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	ll randomint = rand()%(hi+1-lo)+lo;
	cout<<randomint<<" "<<randomint<<endl;
	cin>>s;
	if (s=="Bad") return 0;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	loop:
	while(abs(hi-lo)>4*k+5){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Yes"){
			lo=max(1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	cout<<mid<<" "<<mid<<endl;
	cin>>s;
	if (s=="Yes") return 0;
	else{
		lo=max(1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	loop:
	while(hi-lo>4*k+10){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Bad") return 0;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	int randomint = rand()%(hi+1-lo)+lo;
	cout<<randomint<<" "<<randomint<<endl;
	cin>>s;
	if (s=="Bad") return 0;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	loop:
	while(hi-lo>4*k+5){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Bad") return 0;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	cout<<mid<<" "<<mid<<endl;
	cin>>s;
	if (s=="Bad") return 0;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<int,int>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define vi vector<int>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

int main(){
	ll n,k;
	cin>>n>>k;
	ll var1 = 1;
	ll lo = 1;
	ll hi = n;
	ll mid = (lo+hi)/2;
	string s;
	srand(time(NULL));
	loop:
	while(hi-lo>4*k+2){
		cout<<lo<<" "<<mid<<endl;
		cin>>s;
		if (s=="Bad") return 0;
		if (s=="Yes"){
			lo=max(var1,lo-k);
			hi=min(mid+k,n);
		}
		else{
			lo=max(var1,mid+1-k);
			hi=min(hi+k,n);
		}
		mid=(lo+hi)/2;
	}
	int randomint = rand()%(hi+1-lo)+lo;
	cout<<randomint<<" "<<randomint<<endl;
	cin>>s;
	if (s=="Bad") return 0;
	if (s=="Yes") return 0;
	else{
		lo=max(var1,lo-k);
		hi=min(n,hi+k);
		goto loop;
	}

}


#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
LL n;
LL k;
int cnt = 0;
const int MAXN = 4500;
int main(int argc, char const *argv[])
{
    cin >> n >> k;
    LL lo = 1;
    LL hi = n;
    bool test = false;
    while (cnt < MAXN) {

        int mid = (hi - lo) / 2 + lo;
        if (hi - lo <= 6 * k) {
            test = true;
            int check = rand() % (hi - lo + 1) + lo;
            cout << check << endl;
            cout.flush();
        } else {
            test = false;
            cout << lo << ' ' << mid << endl;
            cout.flush();
        }
        cnt++;

        string s;
        cin >> s;
        if (s.compare("Yes") == 0) {
            if (test == true) return 0;
        } else {
            lo = max(1LL, lo-k);
            hi = min(n, hi+k);
        }
        if (s.compare("No") == 0) {
            lo = max(1LL, mid-k);
            hi = min(n, hi+k);
        }
        if (s.compare("Bad") == 0) {
            break;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
LL n;
LL k;
int cnt = 0;
const int MAXN = 4500;
int main(int argc, char const *argv[])
{
    scanf("%I64d%I64d", &n, &k);
    LL lo = 1;
    LL hi = n;
    bool test = false;
    while (lo <= hi) {

        int mid = (hi - lo) / 2 + lo;
        if (hi - lo <= 6 * k) {
            test = true;
            int check = rand() % (hi - lo + 1) + lo;
            cout << check << ' ' << check << endl;
            fflush(stdout);
        } else {
            test = false;
            cout << lo << ' ' << mid << endl;
            fflush(stdout);
        }
        cnt++;

        char s[10];
        scanf("%s", s);
        if (s[0] == 'Y') {
            if (test == true) return 0;
            else {
                lo = max(1LL, lo-k);
                hi = min(n, mid+k);
            }
        }
        if (s[0] == 'N') {
            lo = max(1LL, mid-k);
            hi = min(n, hi+k);
        }
        if (s[0] == 'B') {
            break;
        }
    }
    cout << lo << ' ' << lo << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
LL n;
LL k;
int cnt = 0;
const int MAXN = 4500;
int main(int argc, char const *argv[])
{
    scanf("%I64d%I64d", &n, &k);
    LL lo = 1;
    LL hi = n;
    bool test = false;
    while (lo <= hi) {

        int mid = (hi - lo) / 2 + lo;
        if (hi - lo <= 6 * k) {
            test = true;
            int check = rand() % (hi - lo + 1) + lo;
            cout << check << ' ' << check << endl;
            fflush(stdout);
        } else {
            test = false;
            cout << lo << ' ' << mid << endl;
            fflush(stdout);
        }
        cnt++;

        char s[10];
        scanf("%s", s);
        if (s[0] == 'Y') {
            if (test == true) return 0;
        } else {
            lo = max(1LL, lo-k);
            hi = min(n, hi+k);
        }
        if (s[0] == 'N') {
            lo = max(1LL, mid-k);
            hi = min(n, hi+k);
        }
        if (s[0] == 'B') {
            break;
        }
    }
    cout << lo << ' ' << lo << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
LL n;
LL k;
int cnt = 0;
const int MAXN = 4500;
int main(int argc, char const *argv[])
{
    srand(time(NULL));
    scanf("%I64d%I64d", &n, &k);
    LL lo = 1;
    LL hi = n;
    bool test = false;
    while (lo <= hi) {

        LL mid = (hi - lo) / 2 + lo;
        if (hi - lo <= 44) {
            test = true;
            LL check = rand() % (hi - lo + 1) + lo;
            cout << check << ' ' << check << endl;
            fflush(stdout);
        } else {
            test = false;
            cout << lo << ' ' << mid << endl;
            fflush(stdout);
        }
        cnt++;

        char s[10];
        scanf("%s", s);
        if (s[0] == 'Y') {
            if (test == true) return 0;
            else {
                lo = max(1LL, lo-k);
                hi = min(n, mid+k);
            }
        }
        if (s[0] == 'N') {
            if (test == true) {
                test = false;
                lo = max(1LL, lo - k);
                hi = min(n, hi + k);
            } else {
                lo = max(1LL, mid-k);
                hi = min(n, hi+k);
            }
        }
        if (s[0] == 'B') {
            break;
        }
    }
    cout << lo << ' ' << lo << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
LL n;
LL k;
int cnt = 0;
const int MAXN = 4500;
int main(int argc, char const *argv[])
{
    scanf("%I64d%I64d", &n, &k);
    LL lo = 1;
    LL hi = n;
    bool test = false;
    while (lo <= hi) {

        int mid = (hi - lo) / 2 + lo;
        if (hi - lo <= 40) {
            test = true;
            int check = rand() % (hi - lo + 1) + lo;
            cout << check << ' ' << check << endl;
            fflush(stdout);
        } else {
            test = false;
            cout << lo << ' ' << mid << endl;
            fflush(stdout);
        }
        cnt++;

        char s[10];
        scanf("%s", s);
        if (s[0] == 'Y') {
            if (test == true) return 0;
            else {
                lo = max(1LL, lo-k);
                hi = min(n, mid+k);
            }
        }
        if (s[0] == 'N') {
            if (test == true) {
                test = false;
                lo = max(1LL, lo - k);
                hi = min(n, hi+k);
            } else {
                lo = max(1LL, mid-k);
                hi = min(n, hi+k);
            }
        }
        if (s[0] == 'B') {
            break;
        }
    }
    cout << lo << ' ' << lo << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
LL n;
LL k;
int cnt = 0;
const int MAXN = 4500;
int main(int argc, char const *argv[])
{
    scanf("%I64d%I64d", &n, &k);
    LL lo = 1;
    LL hi = n;
    bool test = false;
    while (lo <= hi) {

        int mid = (hi - lo) / 2 + lo;
        if (hi - lo <= 44) {
            test = true;
            int check = rand() % (hi - lo + 1) + lo;
            cout << check << ' ' << check << endl;
            fflush(stdout);
        } else {
            test = false;
            cout << lo << ' ' << mid << endl;
            fflush(stdout);
        }
        cnt++;

        char s[10];
        scanf("%s", s);
        if (s[0] == 'Y') {
            if (test == true) return 0;
            else {
                lo = max(1LL, lo-k);
                hi = min(n, mid+k);
            }
        }
        if (s[0] == 'N') {
            if (test == true) {
                test = false;
                lo = max(1LL, lo - k);
                hi = min(n, hi + k);
            } else {
                lo = max(1LL, mid-k);
                hi = min(n, hi+k);
            }
        }
        if (s[0] == 'B') {
            break;
        }
    }
    cout << lo << ' ' << lo << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
LL n;
LL k;
int cnt = 0;
const int MAXN = 4500;
int main(int argc, char const *argv[])
{
    scanf("%I64d%I64d", &n, &k);
    LL lo = 1;
    LL hi = n;
    bool test = false;
    while (lo < hi) {

        int mid = (hi - lo) / 2 + lo;
        if (hi - lo <= 6 * k) {
            test = true;
            int check = rand() % (hi - lo + 1) + lo;
            cout << check << endl;
            fflush(stdout);
        } else {
            test = false;
            cout << lo << ' ' << mid << endl;
            fflush(stdout);
        }
        cnt++;

        char s[10];
        scanf("%s", s);
        if (s[0] == 'Y') {
            if (test == true) return 0;
        } else {
            lo = max(1LL, lo-k);
            hi = min(n, hi+k);
        }
        if (s[0] == 'N') {
            lo = max(1LL, mid-k);
            hi = min(n, hi+k);
        }
        if (s[0] == 'B') {
            break;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
LL n;
LL k;
int cnt = 0;
const int MAXN = 4500;
int main(int argc, char const *argv[])
{
    scanf("%I64d%I64d", &n, &k);
    LL lo = 1;
    LL hi = n;
    bool test = false;
    while (lo <= hi) {

        LL mid = (hi - lo) / 2 + lo;
        if (hi - lo <= 44) {
            test = true;
            LL check = rand() % (hi - lo + 1) + lo;
            cout << check << ' ' << check << endl;
            fflush(stdout);
        } else {
            test = false;
            cout << lo << ' ' << mid << endl;
            fflush(stdout);
        }
        cnt++;

        char s[10];
        scanf("%s", s);
        if (s[0] == 'Y') {
            if (test == true) return 0;
            else {
                lo = max(1LL, lo-k);
                hi = min(n, mid+k);
            }
        }
        if (s[0] == 'N') {
            if (test == true) {
                test = false;
                lo = max(1LL, lo - k);
                hi = min(n, hi + k);
            } else {
                lo = max(1LL, mid-k);
                hi = min(n, hi+k);
            }
        }
        if (s[0] == 'B') {
            break;
        }
    }
    cout << lo << ' ' << lo << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
LL n;
LL k;
int cnt = 0;
const int MAXN = 4500;
int main(int argc, char const *argv[])
{
    scanf("%I64d%I64d", &n, &k);
    LL lo = 1;
    LL hi = n;
    bool test = false;
    while (lo < hi) {

        int mid = (hi - lo) / 2 + lo;
        if (hi - lo <= 6 * k) {
            test = true;
            int check = rand() % (hi - lo + 1) + lo;
            cout << check << ' ' << check << endl;
            fflush(stdout);
        } else {
            test = false;
            cout << lo << ' ' << mid << endl;
            fflush(stdout);
        }
        cnt++;

        char s[10];
        scanf("%s", s);
        if (s[0] == 'Y') {
            if (test == true) return 0;
        } else {
            lo = max(1LL, lo-k);
            hi = min(n, hi+k);
        }
        if (s[0] == 'N') {
            lo = max(1LL, mid-k);
            hi = min(n, hi+k);
        }
        if (s[0] == 'B') {
            break;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
LL n;
LL k;
int cnt = 0;
const int MAXN = 4500;
int main(int argc, char const *argv[])
{
    cin >> n >> k;
    LL lo = 1;
    LL hi = n;
    bool test = false;
    while (cnt < MAXN) {

        int mid = (hi - lo) / 2 + lo;
        if (hi - lo <= 6 * k) {
            test = true;
            int check = rand() % (hi - lo + 1) + lo;
            cout << check << endl;
            cout.flush();
        } else {
            test = false;
            cout << lo << ' ' << mid << endl;
            cout.flush();
        }
        cnt++;

        string s;
        cin >> s;
        if (s.compare("Yes") == 0) {
            if (test == true) return 0;
            lo = max(1LL, lo-k);
            hi = min(n, mid+k);
        }
        if (s.compare("No") == 0) {
            lo = max(1LL, mid-k);
            hi = min(n, hi+k);
        }
        if (s.compare("Bad") == 0) {
            break;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
LL n;
LL k;
int cnt = 0;
const int MAXN = 4500;
int main(int argc, char const *argv[])
{
    cin >> n >> k;
    LL lo = 1;
    LL hi = n;
    bool test = false;
    while (cnt < MAXN) {

        int mid = (hi - lo) / 2 + lo;
        if (hi - lo <= 6 * k) {
            test = true;
            int check = rand() % (hi - lo + 1) + lo;
            cout << check << endl;
            fflush(stdout);
        } else {
            test = false;
            cout << lo << ' ' << mid << endl;
            fflush(stdout);
        }
        cnt++;

        string s;
        cin >> s;
        if (s[0] == 'Y') {
            if (test == true) return 0;
        } else {
            lo = max(1LL, lo-k);
            hi = min(n, hi+k);
        }
        if (s[0] == 'N') {
            lo = max(1LL, mid-k);
            hi = min(n, hi+k);
        }
        if (s[0] == 'B') {
            break;
        }
    }
    return 0;
}


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

int main()
{
    srand(time(0));
    long long n;
    int k;
    cin>>n>>k;
    int rem = 4500;
    long long l = 1  ,r  = n;
    while(1)
    {
        string s;
        if(r-l+1 <= 50)
        {
            long long a = rand()%(r-l+1) + l;
            cout<<a<<" "<<a<<endl;
            cin>>s;
            if(s=="Yes") return 0;
            l = max(l - k , 1ll);
            r = min(n , r+k);
        }
        else
        {
            long long mid = l + (r-l)/2;
            cout<<l<<" "<<mid<<endl;
            cin>>s;
            if(s=="Yes")
            {
                if(l == mid) return 0;
                r = min(n , mid+k) , l = max(1ll , l - k);
            }
            else if(s=="No") l = max(1ll , mid-k) , r = min(n , r+k);
        }
    }
}


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

int main()
{
    srand(time(0));
    long long n;
    int k;
    cin>>n>>k;
    int rem = 4500;
    long long l = 1  ,r  = n;
    while(r - l > 50)
    {
        long long mid = l + (r-l)/2;
        cout<<l<<" "<<mid<<endl;
        string s;
        cin>>s;
        if(s=="Yes") r = min(n , mid+k) , l = max(1ll , l - k);
        else if(s=="No") l = max(1ll , mid-k) , r = min(n , r+k);
        rem--;
    }
    int d = r-l+1;
    while(rem--)
    {
        int x = rand()%d;
        long long a = l +x;
        cout<<a<<" "<<a<<endl;
        string s;
        cin>>s;
        if(s == "Yes") return 0;
        //
        l = max(1ll , l -k);
        r = min(n , r+k);
        d = r-l+1;
    }
}


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

int main()
{
    srand(time(0));
    long long n;
    int k;
    cin>>n>>k;
    int rem = 4500;
    long long l = 1  ,r  = n;
    while(r - l > 100)
    {
        long long mid = l + (r-l)/2;
        cout<<l<<" "<<mid<<endl;
        string s;
        cin>>s;
        if(s=="Yes")
        {
            if(l == mid) return 0;
            r = min(n , mid+k) , l = max(1ll , l - k);
        }
        else if(s=="No") l = max(1ll , mid-k) , r = min(n , r+k);
        rem--;
    }
    int d = r-l+1;
    while(rem--)
    {
        int x = rand()%d;
        long long a = l +x;
        cout<<a<<" "<<a<<endl;
        string s;
        cin>>s;
        if(s == "Yes") return 0;
        //
        l = max(1ll , l -k);
        r = min(n , r+k);
        d = r-l+1;
    }
}


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

int main()
{
    srand(time(0));
    long long n;
    int k;
    cin>>n>>k;
    int rem = 4500;
    long long l = 1  ,r  = n;
    while(r - l > 50)
    {
        long long mid = l + (r-l)/2;
        cout<<l<<" "<<mid<<endl;
        string s;
        cin>>s;
        if(s=="Yes")
        {
            if(l==r) return 0;
            r = min(n , mid+k) , l = max(1ll , l - k);
        }
        else if(s=="No") l = max(1ll , mid-k) , r = min(n , r+k);
        rem--;
    }
    int d = r-l+1;
    while(rem--)
    {
        int x = rand()%d;
        long long a = l +x;
        cout<<a<<" "<<a<<endl;
        string s;
        cin>>s;
        if(s == "Yes") return 0;

    }
}


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

int main()
{
    srand(time(0));
    long long n;
    int k;
    cin>>n>>k;
    int rem = 4500;
    long long l = 1  ,r  = n;
    while(1)
    {
        string s;
        if(r-l+1 <= 50)
        {
            long long a =  rand()%(r-l+1) + l;
            cout<<a<<" "<<a<<endl;
            cin>>s;
            if(s=="Yes") return 0;
            l = max(l - k , 1ll);
            r = min(n , r+k);
        }
        else
        {
            long long mid = l + (r-l)/2;
            cout<<l<<" "<<mid<<endl;
            cin>>s;
            if(s=="Yes")
            {
                if(l == mid) return 0;
                r = min(n , mid+k) , l = max(1ll , l - k);
            }
            else if(s=="No") l = max(1ll , mid-k) , r = min(n , r+k);
        }
    }
}


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

int main()
{
    srand(time(0));
    long long n;
    int k;
    cin>>n>>k;
    int rem = 4500;
    long long l = 1  ,r  = n;
    while(r - l > 50 && rem > 1000)
    {
        long long mid = l + (r-l)/2;
        cout<<l<<" "<<mid<<endl;
        string s;
        cin>>s;
        if(s=="Yes")
        {
            if(l == mid) return 0;
            r = min(n , mid+k) , l = max(1ll , l - k);
        }
        else if(s=="No") l = max(1ll , mid-k) , r = min(n , r+k);
        rem--;
    }
    int d = r-l+1;
    while(rem--)
    {
        int x = rand()%d;
        long long a = l +x;
        cout<<a<<" "<<a<<endl;
        string s;
        cin>>s;
        if(s == "Yes") return 0;
        //
        l = max(1ll , l -k);
        r = min(n , r+k);
        d = r-l+1;
    }
}